personal.xsd
上传用户:zhuqijet
上传日期:2013-06-25
资源大小:10074k
文件大小:3k
源码类别:

词法分析

开发平台:

Visual C++

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
  3.  <xs:import namespace="http://www.w3.org/XML/1998/namespace">
  4.    <xs:annotation>
  5.      <xs:documentation>
  6.         The schemaLocation of the relevant file is
  7.         "http://www.w3.org/2001/xml.xsd"; however,
  8.         we don't want to assume people are always
  9.         connected to the 'net when playing with this file.
  10.      </xs:documentation>
  11.    </xs:annotation>
  12.  </xs:import>
  13.  <xs:element name="personnel">
  14.   <xs:complexType>
  15.    <xs:sequence>
  16.      <xs:element ref="person" minOccurs='1' maxOccurs='unbounded'/>
  17.    </xs:sequence>
  18.   </xs:complexType>
  19.   <xs:unique name="unique1">
  20.    <xs:selector xpath="person"/>
  21.    <xs:field xpath="name/given"/>
  22.    <xs:field xpath="name/family"/>
  23.   </xs:unique>
  24.   <xs:key name='empid'>
  25.    <xs:selector xpath="person"/>
  26.    <xs:field xpath="@id"/>
  27.   </xs:key>
  28.   <xs:keyref name="keyref1" refer='empid'>
  29.    <xs:selector xpath="person"/> 
  30.    <xs:field xpath="link/@manager"/>  
  31.   </xs:keyref>
  32.  </xs:element>
  33.  <xs:element name="person">
  34.   <xs:complexType>
  35.    <xs:sequence>
  36.      <xs:element ref="name"/>
  37.      <xs:element ref="email" minOccurs='0' maxOccurs='unbounded'/>
  38.      <xs:element ref="url"   minOccurs='0' maxOccurs='unbounded'/>
  39.      <xs:element ref="link"  minOccurs='0' maxOccurs='1'/>
  40.    </xs:sequence>
  41.    <xs:attribute name="id"  type="xs:ID" use='required'/>
  42.    <xs:attribute name="note" type="xs:string"/>
  43.    <xs:attribute name="contr" default="false">
  44.     <xs:simpleType>
  45.      <xs:restriction base = "xs:string">
  46.        <xs:enumeration value="true"/>
  47.        <xs:enumeration value="false"/>
  48.      </xs:restriction>
  49.     </xs:simpleType>
  50.    </xs:attribute>
  51.    <xs:attribute name="salary" type="xs:integer"/>
  52.    <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
  53.   </xs:complexType>
  54.  </xs:element>
  55.  <xs:element name="name">
  56.   <xs:complexType>
  57.    <xs:all>
  58.     <xs:element ref="family"/>
  59.     <xs:element ref="given"/>
  60.    </xs:all>
  61.    <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
  62.   </xs:complexType>
  63.  </xs:element>
  64.  <xs:element name="family">
  65.    <xs:complexType>
  66.      <xs:simpleContent>
  67.        <xs:extension base='xs:string'>
  68.           <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
  69.         </xs:extension>
  70.      </xs:simpleContent>
  71.    </xs:complexType>
  72.  </xs:element>
  73.  <xs:element name="given" >
  74.    <xs:complexType>
  75.      <xs:simpleContent>
  76.        <xs:extension base='xs:string'>
  77.           <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
  78.         </xs:extension>
  79.      </xs:simpleContent>
  80.    </xs:complexType>
  81.  </xs:element>
  82.  <xs:element name="email" type='xs:string'/>
  83.  <xs:element name="url">
  84.   <xs:complexType>
  85.    <xs:attribute name="href" type="xs:string" default="http://"/>
  86.   </xs:complexType>
  87.  </xs:element>
  88.  <xs:element name="link">
  89.   <xs:complexType>
  90.    <xs:attribute name="manager" type="xs:IDREF"/>
  91.    <xs:attribute name="subordinates" type="xs:IDREFS"/>
  92.   </xs:complexType>
  93.  </xs:element>
  94.  <xs:notation name='gif' public='-//APP/Photoshop/4.0' system='photoshop.exe'/>
  95. </xs:schema>