<?xml version="1.0" encoding="UTF-8"?>
<!--
    Source: http://www.dmtf.org/standards/published_documents/DSP8027_1.0.0.xsd
    Notice 
    DSP8027
    Document: OVF XML Schema Specification, ovf-environment.xsd
    Version: 1.0.0b
    Status: Work in Progress - Expires September 30, 2008
    Notice - This document is subject to change without notice
    Date: 07/03/2008
    Description: XML schema specification for Open Virtualization Format.
    
    Copyright © 2008 Distributed Management Task Force, Inc. (DMTF). All rights reserved. DMTF is a not-for-profit association of industry members dedicated to promoting enterprise and systems management and interoperability. Members and non-members may reproduce DMTF specifications and documents for uses consistent with this purpose, provided that correct attribution is given. As DMTF specifications may be revised from time to time, the particular version and release date should always be noted. Implementation of certain elements of this standard or proposed standard may be subject to third party patent rights, including provisional patent rights (herein "patent rights"). DMTF makes no representations to users of the standard as to the existence of such rights, and is not responsible to recognize, disclose, or identify any or all such third party patent right, owners or claimants, nor for any incomplete or inaccurate identification or disclosure of such rights, owners or claimants. DMTF shall have no liability to any party, in any manner or circumstance, under any legal theory whatsoever, for failure to recognize, disclose, or identify any such third party patent rights, or for such party’s reliance on the standard or incorporation thereof in its product, protocols or testing procedures. DMTF shall have no liability to any party implementing such standard, whether such implementation is foreseeable or not, nor to any patent owner or claimant, and shall have no liability or responsibility for costs or losses incurred if a standard is withdrawn or modified after publication, and shall be indemnified and held harmless by any party implementing the standard from any and all claims of infringement by a patent owner for such implementations. For information about patents held by third-parties which have notified the DMTF that, in their opinion, such patent may relate to or impact implementations of DMTF standards, visit http://www.dmtf.org/about/policies/disclosures.php.
-->
<xs:schema targetNamespace="http://schemas.dmtf.org/ovf/environment/1"
    xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    attributeFormDefault="qualified" 
    elementFormDefault="qualified">

    <!--- XML Schema 1.1 syntax: All defined types are extensible at the end
        
        <xs:openContent mode="suffix">
        <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:openContent>
        
    -->

    <xs:element name="Environment" type="ovfenv:Environment_Type">
        <xs:annotation>
            <xs:documentation>Root element of OVF environment</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="Environment_Type">
        <xs:annotation>
            <xs:documentation>Type for root OVF environment</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="ovfenv:Section" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>Entity independent meta-data sections</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Entity" type="ovfenv:Entity_Type" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>Meta-data particular to a given entity</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>        
        <xs:attribute name="id" type="xs:string" default="" use="optional">
            <xs:annotation>
                <xs:documentation>Identifier matching recipient of this environment</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="Entity_Type">
        <xs:annotation>
            <xs:documentation>Container of sections for a specific entity </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="ovfenv:Section" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Entity identifier</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <!-- SECTION -->

    <xs:element name="Section" type="ovfenv:Section_Type">
        <xs:annotation>
            <xs:documentation>Base elements for OVF environment sections. This is the head of the substitution
            group.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="Section_Type" abstract="true">
        <xs:annotation>
            <xs:documentation>Abstract type for all sections in environment</xs:documentation>
        </xs:annotation>
    </xs:complexType>

    <!-- CORE SECTIONS -->

    <xs:element name="PropertySection" type="ovfenv:PropertySection_Type" substitutionGroup="ovfenv:Section">
        <xs:annotation>
            <xs:documentation>Element substitutable for Property since PropertySection_Type is a derivation of
                Section_Type </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="PropertySection_Type">
        <xs:annotation>
            <xs:documentation>Key/value pairs of assigned properties for an entity</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="ovfenv:Section_Type">
                <xs:sequence>
                    <xs:element name="Property" minOccurs="0" maxOccurs="unbounded">
                        <xs:complexType>
                            <xs:attribute name="key" type="xs:string"/>
                            <xs:attribute name="value" type="xs:string"/>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="PlatformSection" type="ovfenv:PlatformSection_Type" substitutionGroup="ovfenv:Section">
        <xs:annotation>
            <xs:documentation>Element substitutable for Platform since Platform_Type is a derivation of Section_Type
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="PlatformSection_Type">
        <xs:annotation>
            <xs:documentation>Information about deployment platform</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="ovfenv:Section_Type">
                <xs:sequence>
                    <xs:element name="Kind" type="xs:string" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>Deployment platform description</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="Version" type="xs:string" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>Deployment platform version</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="Vendor" type="xs:string" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>Deployment platform vendor</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="Locale" type="xs:string" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>Current locale</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="Timezone" type="xs:int" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>Current timezone offset in minutes from UTC. Time zones east of Greenwich
                                are positive and time zones west of Greenwich are negative.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>
