<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://tizen.org/ns/packages" xmlns:packages="http://tizen.org/ns/packages">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
  <xs:element name="manifest">
    <xs:complexType>
      <xs:sequence>
        <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax"/>
      </xs:sequence>
<!-- for reference
      <xs:choice maxOccurs="unbounded">
        <xs:element ref="packages:author"/>
        <xs:element ref="packages:description"/>
        <xs:element ref="packages:label"/>
        <xs:element ref="packages:icon"/>
        <xs:element ref="packages:metadata"/>
        <xs:element ref="packages:allowed-package"/>
        <xs:element ref="packages:dependencies"/>
      </xs:choice>
-->
      <xs:attribute name="package" type="xs:string"/>
      <xs:attribute name="version" type="xs:string"/>
      <xs:attribute name="res-type" type="xs:string"/>
      <xs:attribute name="res-version" type="xs:string"/>
      <xs:attribute name="api-version" type="xs:string"/>
      <xs:attribute name="lib" type="xs:boolean"/>
      <xs:anyAttribute namespace="##any" processContents="lax"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="author">
    <xs:complexType mixed="true">
      <xs:attribute name="email"/>
      <xs:attribute name="href"/>
      <xs:anyAttribute namespace="##any" processContents="lax"/>
      <!-- <xs:attribute ref="xml:lang"/> -->
    </xs:complexType>
  </xs:element>
  <xs:element name="description">
    <xs:complexType mixed="true">
      <xs:anyAttribute namespace="##any" processContents="lax"/>
      <!-- <xs:attribute ref="xml:lang"/> -->
    </xs:complexType>
  </xs:element>
  <xs:element name="label">
    <xs:complexType mixed="true">
      <xs:anyAttribute namespace="##any" processContents="lax"/>
      <!-- <xs:attribute ref="xml:lang"/> -->
    </xs:complexType>
  </xs:element>
  <xs:element name="icon">
    <xs:complexType mixed="true">
      <!-- <xs:attribute ref="xml:lang"/> -->
      <xs:attribute name="section" type="xs:string"/>
      <xs:attribute name="resolution" type="packages:ResolutionType"/>
      <xs:attribute name="dpi" type="xs:string"/>
      <xs:anyAttribute namespace="##any" processContents="lax"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="metadata">
    <xs:complexType>
      <xs:attribute name="key" use="required" type="xs:string"/>
      <xs:attribute name="value" type="xs:string"/>
      <xs:anyAttribute namespace="##any" processContents="lax"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="allowed-package">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded" minOccurs="0">
        <xs:element ref="packages:required-privileges"/>
      </xs:choice>
      <xs:attribute name="id" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="required-privileges">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded" minOccurs="1">
        <xs:element name="privilege"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="dependencies">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded" minOccurs="1">
        <xs:element ref="packages:dependency"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="dependency">
    <xs:complexType mixed="true">
      <xs:attribute name="type" use="required" type="packages:DependencyType"/>
      <xs:attribute name="required-version" type="xs:string"/>
      <xs:anyAttribute namespace="##any" processContents="lax"/>
    </xs:complexType>
  </xs:element>
  <xs:simpleType name="DependencyType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="requires"/>
      <xs:enumeration value="wants"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ResolutionType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="xhigh"/>
      <xs:enumeration value="high"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>