emp.xsd
上传用户:hbhltzc
上传日期:2022-06-04
资源大小:1925k
文件大小:5k
源码类别:

xml/soap/webservice

开发平台:

Visual C++

  1. <?xml version="1.0"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://Employees" xmlns="http://Employees">
  3.   <xs:complexType name="Country">
  4.     <xs:sequence>
  5.       <xs:element name="Name" type="xs:string" default="U.S.A."/>
  6.     </xs:sequence>
  7.     <xs:attribute name="code" type="xs:language">
  8.       <xs:annotation>
  9.         <xs:documentation>The registered IANA country code of the format xx-xx.  For example: en-us.</xs:documentation>
  10.       </xs:annotation>
  11.     </xs:attribute>
  12.   </xs:complexType>
  13.   <xs:simpleType name="City">
  14.     <xs:restriction base="xs:string">
  15.       <xs:minLength value="1" />
  16.       <xs:maxLength value="50" />
  17.     </xs:restriction>
  18.   </xs:simpleType>
  19.   <xs:simpleType name="Zip">
  20.     <xs:restriction base="xs:positiveInteger">
  21.       <xs:maxInclusive value="99999" />
  22.       <xs:minInclusive value="10000" />
  23.     </xs:restriction>
  24.   </xs:simpleType>
  25.   <xs:simpleType name="EmployeeID">
  26.     <xs:annotation>
  27.       <xs:documentation>The ITG assigned 5 digit employee identification</xs:documentation>
  28.     </xs:annotation>
  29.     <xs:restriction base="xs:string">
  30.       <xs:length value="5" />
  31.     </xs:restriction>
  32.   </xs:simpleType>
  33.   <xs:attributeGroup name="EmployeeAttributes">
  34.     <xs:attribute name="id" type="EmployeeID" use="required" />
  35.     <xs:attribute name="hireDate" type="xs:date" />
  36.     <xs:attribute name="title" type="Role" default="SDE" />
  37.     <xs:attribute name="fullTime" type="xs:boolean" />
  38.   </xs:attributeGroup>
  39.   <xs:element name="Street" type="xs:string">
  40.     <xs:annotation>
  41.       <xs:documentation>Full street address including apartment number</xs:documentation>
  42.     </xs:annotation>
  43.   </xs:element>
  44.   <xs:group name="Address">
  45.     <xs:sequence>
  46.       <xs:element ref="Street" />
  47.       <xs:element name="City" type="City">
  48.         <xs:annotation>
  49.           <xs:documentation>City of residence</xs:documentation>
  50.         </xs:annotation>
  51.       </xs:element>
  52.       <xs:element name="Zip" type="Zip">
  53.         <xs:annotation>
  54.           <xs:documentation>The postal code or zip code</xs:documentation>
  55.         </xs:annotation>
  56.       </xs:element>
  57.       <xs:element name="Country" type="Country">
  58.         <xs:annotation>
  59.           <xs:documentation>The country of origin</xs:documentation>
  60.         </xs:annotation>
  61.       </xs:element>
  62.       <xs:element name="Office">
  63.         <xs:annotation>
  64.           <xs:documentation>The building and room number, for example 35/5562</xs:documentation>
  65.         </xs:annotation>
  66.         <xs:simpleType>
  67.           <xs:restriction base="xs:string">
  68.             <xs:pattern value="d+/d+" />
  69.           </xs:restriction>
  70.         </xs:simpleType>
  71.       </xs:element>
  72.     </xs:sequence>
  73.   </xs:group>
  74.   <xs:simpleType name="Role">
  75.     <xs:restriction base="xs:string">
  76.       <xs:enumeration value="Architect">
  77.       </xs:enumeration>
  78.       <xs:enumeration value="Development Manager" />
  79.       <xs:enumeration value="GPM" />
  80.       <xs:enumeration value="Group Manager" />
  81.       <xs:enumeration value="PM" />
  82.       <xs:enumeration value="PM Lead" />
  83.       <xs:enumeration value="Product Manager" />
  84.       <xs:enumeration value="Product Unit Manager" />
  85.       <xs:enumeration value="SDE/Lead" />
  86.       <xs:enumeration value="SDE" />
  87.       <xs:enumeration value="SDE/T " />
  88.       <xs:enumeration value="SDE/T Lead" />
  89.       <xs:enumeration value="Test Manager" />
  90.     </xs:restriction>
  91.   </xs:simpleType>
  92.   <xs:complexType name="Employee">
  93.     <xs:annotation>
  94.       <xs:documentation>
  95.         This Employee element contains no useful annotation,
  96.         but it is interesting to see what can be done using annotations
  97.         and the XML editor.
  98.       </xs:documentation>
  99.     </xs:annotation>
  100.     <xs:sequence>
  101.       <xs:element name="Name">
  102.         <xs:annotation>
  103.           <xs:documentation>The name of the employee, in their native language. This must match the name they use on their tax filing.</xs:documentation>
  104.         </xs:annotation>
  105.         <xs:complexType>
  106.           <xs:sequence>
  107.             <xs:element name="First" type="xs:string" />
  108.             <xs:element name="Middle" type="xs:string" minOccurs="0" />
  109.             <xs:element name="Last" type="xs:string" />
  110.           </xs:sequence>
  111.         </xs:complexType>
  112.       </xs:element>
  113.       <xs:group ref="Address" />
  114.       <xs:element name="Photo" type="xs:anyURI"/>
  115.       <xs:any namespace="##any" maxOccurs="unbounded" minOccurs="0" />
  116.     </xs:sequence>
  117.     <xs:attributeGroup ref="EmployeeAttributes" />
  118.   </xs:complexType>
  119.   <xs:element name="Employee" type="Employee" />
  120.   <xs:element name="Employees">
  121.     <xs:complexType>
  122.       <xs:sequence minOccurs="1" maxOccurs="unbounded">
  123.         <xs:element ref="Employee" />
  124.       </xs:sequence>
  125.     </xs:complexType>
  126.     <xs:unique name="UniqueId">
  127.       <xs:selector xpath="Employee"/>
  128.       <xs:field xpath="@id"/>
  129.     </xs:unique>
  130.   </xs:element>
  131.   <xs:complexType name="AddressType">
  132.     <xs:sequence>
  133.       <xs:element name="Street" type="xs:string" />
  134.       <xs:element name="City" type="xs:string"/>
  135.       <xs:choice>
  136.         <xs:element name="Zip" type="xs:int"/>
  137.         <xs:element name="postalCode" type="xs:string"/>
  138.       </xs:choice>      
  139.     </xs:sequence>
  140.     <xs:attribute name="first" type="xs:int"/>
  141.     <xs:attribute name="attr2" type="xs:string"/>
  142.   </xs:complexType>
  143. </xs:schema>