<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Validation of the HSPS manifest files -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">  

<!-- Version type -->
<xs:simpleType name="versiontype">           
  <xs:restriction base="xs:decimal">          
    <xs:pattern value="[0-9].[0-9]"/>
  </xs:restriction>    
</xs:simpleType>

<!-- Localized type -->
<xs:simpleType name="localizedtype">
  <xs:restriction base="xs:string">
    <xs:pattern value="[&#38;][q][t][n][_]([a-z_A-Z0-9])*[;]"/>
  </xs:restriction>
</xs:simpleType>

<!-- Hex string -->
<xs:simpleType name="hexstringtype">
  <xs:restriction base="xs:string">
    <xs:pattern value="([a-f_A-FxX0-9])*"/>
  </xs:restriction>
</xs:simpleType>

<!-- Filename type -->
<xs:simpleType name="filenametype">
  <xs:restriction base="xs:string">
    <xs:pattern value="([a-z_A-Z0-9])*"/>
  </xs:restriction>
</xs:simpleType>

<!-- Fileresource type -->
<xs:complexType name="fileresourcetype">       
  <xs:simpleContent>
    <xs:extension base="xs:string">      
      <xs:attribute name="mediatype">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="100"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>                            
    </xs:extension>
  </xs:simpleContent>                    
</xs:complexType>


<!-- Structure of a manifest file -->
<xs:element name="package">    
  <xs:complexType>
    <xs:sequence>
         
      <xs:element name="family" type="xs:string"/>         
          
  	  <xs:element name="type"> 
    	  <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:pattern value="application|view|widget|template"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element> 
      
  	  <xs:element name="interfaceuid" type="hexstringtype"/>
  	      	          
      <xs:element name="provideruid" type="hexstringtype"/>
      
      <xs:element name="configurationuid" type="hexstringtype"/>      
      
      <xs:element name="status" minOccurs="0" maxOccurs="unbounded"> 
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:pattern value="statusmakeactive|statuslicenceedefault|statuslicenceerestorable|statusoperatordefault|statususerdefault"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      
      <xs:element name="fullname" type="xs:string"/> 
      
      <xs:element name="shortname" type="filenametype"/>
      
      <xs:element name="version" type="versiontype"/> 
      
      <xs:element name="description" type="xs:string" minOccurs="0"/> 
      
      <xs:element name="filelogo" type="xs:string" minOccurs="0"/> 
      
      <xs:element name="filepreview" type="xs:string" minOccurs="0"/> 
            
      <xs:element name="filexml" type="xs:string"/> 
      
      <xs:element name="filedtd" type="xs:string" minOccurs="0"/>
      
      <xs:element name="fileresource" type="fileresourcetype" minOccurs="0" maxOccurs="unbounded"/>
      
      <xs:element name="localization" minOccurs="0">
        <xs:complexType>     
          <xs:sequence>                      
            <xs:element name="fileresource" type="fileresourcetype" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>          
        </xs:complexType>        
      </xs:element>
      
  	</xs:sequence>  	    	
  	<xs:attribute name="version" use="required">	        
  	    <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:pattern value="1.0"/>
          </xs:restriction>
        </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:element>
  
</xs:schema>