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

词法分析

开发平台:

Visual C++

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified"  xmlns:foo="http://anothernamespace.com" >
  3. <xs:import namespace="http://www.secondSchema" schemaLocation="SecondSchema.xsd" />
  4. <xs:element name="root" type="rootType" />
  5. <xs:complexType name="rootType" >
  6.   <xs:sequence>
  7.     <xs:element name="attrTest" type="attrTestType" />
  8.     <xs:element name="eleTest" type="eleTestType" />
  9.     <xs:element name="simpleDerTest" type="simpleDerTestType" />
  10.     <xs:element name="complexTest" type="complexTestType" />
  11.     <xs:element name="complexDerTest" type="complexDerTestType" />
  12.     <xs:element name="unionTest" type="unionTest" />
  13.     <xs:element name="anonymousTest" >
  14.       <xs:complexType>
  15.         <xs:sequence>
  16.           <xs:element name="quantity">
  17.             <xs:simpleType>
  18.               <xs:restriction base="xs:positiveInteger">
  19.                 <xs:maxExclusive value="100"/>
  20.               </xs:restriction>
  21.             </xs:simpleType>
  22.           </xs:element>
  23.           <xs:element name='size'>
  24.             <xs:simpleType>
  25.               <xs:union>
  26.                 <xs:simpleType>
  27.                   <xs:restriction base='xs:integer'/>
  28.                 </xs:simpleType>
  29.                 <xs:simpleType>
  30.                   <xs:restriction base='xs:string'/>
  31.                 </xs:simpleType>
  32.               </xs:union>
  33.             </xs:simpleType>
  34.           </xs:element>
  35.           <xs:element ref="anonElement" />
  36.         </xs:sequence>
  37.         <xs:attribute name="partNum" >
  38.           <xs:simpleType>
  39.             <xs:restriction base="xs:positiveInteger">
  40.               <xs:maxExclusive value="100"/>
  41.             </xs:restriction>
  42.           </xs:simpleType>
  43.         </xs:attribute>
  44.       </xs:complexType>       
  45.     </xs:element>
  46.     <xs:element name="xsiTypeTest" type="xsiTypeTestType" />
  47.     <xs:element name="anyTestPartial" type="anyTestPartialType" />
  48.     <xs:element name="anyTest" type="anyTestType" />
  49.     <xs:element name="anyTestAttr1" type="anyTestAttr1Type" />
  50.     <xs:element name="anyTestAttr2" type="anyTestAttr2Type" />
  51.     <xs:element name="anyTestMissing" type="anyTestType" />
  52.     <xs:element name="invalidTest" type="invalidTestType" />
  53.   </xs:sequence>
  54. </xs:complexType>
  55. <xs:complexType name="anyTestPartialType" >
  56.   <xs:sequence >
  57.      <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip" />
  58.      <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" />
  59.      <xs:any namespace="http://www.secondSchema" processContents="lax" />
  60.  </xs:sequence>
  61.   <xs:anyAttribute namespace="http://www.w3.org/1999/xhtml" processContents="skip" />
  62. </xs:complexType>
  63. <xs:complexType name="anyTestType" >
  64.   <xs:sequence >
  65.      <xs:any namespace="http://www.secondSchema" processContents="lax"/>
  66.      <xs:any namespace="http://www.secondSchema" processContents="strict"/>
  67.      <xs:any namespace="http://www.secondSchema" processContents="strict"/>
  68.  </xs:sequence>
  69.   <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" />
  70. </xs:complexType>
  71. <xs:complexType name="anyTestAttr1Type" >
  72.   <xs:anyAttribute namespace="http://www.secondSchema" processContents="strict" />
  73. </xs:complexType>
  74. <xs:complexType name="anyTestAttr2Type" >
  75.   <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" />
  76. </xs:complexType>
  77. <xs:complexType name="invalidTestType" >
  78.   <xs:sequence >
  79.     <xs:element name="simple" type="stringDerivedType" />
  80.     <xs:element name="complex" type="baseComplex" />
  81.     <xs:element name="number" type="base" />
  82.     <xs:element name="complexXsi" type="baseComplex" />
  83.     <xs:element name="unionTest" type="uType" />
  84.     <xs:element name="invalidAttrTest" type="attrOnlyType" />
  85.     <xs:element name="missingAttrTest" type="attrOnlyType" />
  86.     <xs:element name="prohibitedAttrTest" type="prohibitedAttrType" />
  87.   </xs:sequence>
  88.   <xs:attribute name="simple" type="stringDerivedType" />
  89. </xs:complexType>
  90. <xs:complexType name="prohibitedAttrType" >
  91.   <xs:attribute name="attr" type="stringDerivedType"  use="prohibited" />
  92. </xs:complexType>
  93. <xs:complexType name="attrOnlyType" >
  94.   <xs:attribute name="attr" type="stringDerivedType"  use="required" />
  95. </xs:complexType>
  96. <xs:simpleType name="uType" >
  97.   <xs:union memberTypes="stringDerivedType" />
  98. </xs:simpleType>
  99. <xs:complexType name="xsiTypeTestType" >
  100.   <xs:sequence>
  101.     <xs:element name="number" type="base" maxOccurs="3"/>
  102.     <xs:element name="complexXsi" type="baseComplex" maxOccurs="3"/>
  103.   </xs:sequence>
  104. </xs:complexType>
  105. <xs:complexType name="baseComplex" >
  106.   <xs:sequence>
  107.     <xs:element name="a" type="xs:string" />
  108.   </xs:sequence>
  109. </xs:complexType>
  110. <xs:complexType name="level1Complex" >
  111.   <xs:complexContent >
  112.     <xs:extension base="baseComplex" >
  113.       <xs:sequence>
  114.         <xs:element name="b" type="xs:string"/>
  115.       </xs:sequence>
  116.     </xs:extension>
  117.   </xs:complexContent>
  118. </xs:complexType>
  119. <xs:complexType name="level2Complex" >
  120.   <xs:complexContent >
  121.     <xs:extension base="level1Complex" >
  122.       <xs:sequence>
  123.         <xs:element name="c" type="xs:string"/>
  124.       </xs:sequence>
  125.     </xs:extension>
  126.   </xs:complexContent>
  127. </xs:complexType>
  128. <xs:simpleType name="base" >
  129.   <xs:restriction base="xs:decimal" >
  130.     <xs:maxExclusive value="100"/>
  131.   </xs:restriction>
  132. </xs:simpleType>
  133. <xs:simpleType name="level1" >
  134.   <xs:restriction base="base" >
  135.     <xs:maxExclusive value="75"/>
  136.   </xs:restriction>
  137. </xs:simpleType>
  138. <xs:simpleType name="level2" >
  139.   <xs:restriction base="level1" >
  140.     <xs:maxExclusive value="50"/>
  141.   </xs:restriction>
  142. </xs:simpleType>
  143. <xs:element name="anonElement" >
  144.   <xs:simpleType >
  145.     <xs:restriction base="xs:decimal" >
  146.       <xs:maxExclusive value="100"/>
  147.     </xs:restriction>
  148.   </xs:simpleType>
  149. </xs:element>
  150. <xs:complexType name="eleTestType" >
  151.   <xs:sequence >
  152.     <xs:element name="level1string" type="xs:string" />
  153.     <xs:element name="level1boolean" type="xs:boolean" />
  154.     <xs:element name="level1decimal" type="xs:decimal" />
  155.     <xs:element name="level1float" type="xs:float" />
  156.     <xs:element name="level1double" type="xs:double" />
  157.     <xs:element name="level1duration" type="xs:duration" />
  158.     <xs:element name="level1dateTime" type="xs:dateTime" />
  159.     <xs:element name="level1time" type="xs:time" />
  160.     <xs:element name="level1date" type="xs:date" />
  161.     <xs:element name="level1gYearMonth" type="xs:gYearMonth" />
  162.     <xs:element name="level1gYear" type="xs:gYear" />
  163.     <xs:element name="level1gMonthDay" type="xs:gMonthDay" />
  164.     <xs:element name="level1gDay" type="xs:gDay" />
  165.     <xs:element name="level1gMonth" type="xs:gMonth" />
  166.     <xs:element name="level1hexBinary" type="xs:hexBinary" />
  167.     <xs:element name="level1base64Binary" type="xs:base64Binary" />
  168.     <xs:element name="level1anyURI" type="xs:anyURI" />
  169.     <xs:element name="level1QName" type="xs:QName" />
  170.     <xs:element name="level1normalizedString" type="xs:normalizedString" />
  171.     <xs:element name="level1token" type="xs:token" />
  172.     <xs:element name="level1language" type="xs:language" />
  173.     <xs:element name="level1NMTOKEN" type="xs:NMTOKEN" />
  174.     <xs:element name="level1NMTOKENS" type="xs:NMTOKENS" />
  175.     <xs:element name="level1Name" type="xs:Name" />
  176.     <xs:element name="level1NCName" type="xs:NCName" />
  177.     <xs:element name="level1integer" type="xs:integer" />
  178.     <xs:element name="level1nonPositiveInteger" type="xs:nonPositiveInteger" />
  179.     <xs:element name="level1negativeInteger" type="xs:negativeInteger" />
  180.     <xs:element name="level1long" type="xs:long" />
  181.     <xs:element name="level1int" type="xs:int" />
  182.     <xs:element name="level1short" type="xs:short" />
  183.     <xs:element name="level1byte" type="xs:byte" />
  184.     <xs:element name="level1nonNegativeInteger" type="xs:nonNegativeInteger" />
  185.     <xs:element name="level1unsignedLong" type="xs:unsignedLong" />
  186.     <xs:element name="level1unsignedInt" type="xs:unsignedInt" />
  187.     <xs:element name="level1unsignedShort" type="xs:unsignedShort" />
  188.     <xs:element name="level1unsignedByte" type="xs:unsignedByte" />
  189.     <xs:element name="level1positiveInteger" type="xs:positiveInteger" />
  190.   </xs:sequence>
  191. </xs:complexType>
  192. <xs:complexType name="attrTestType" >
  193.   <xs:attribute name="string" type="xs:string" />
  194.   <xs:attribute name="boolean" type="xs:boolean" />
  195.   <xs:attribute name="decimal" type="xs:decimal" />
  196.   <xs:attribute name="float" type="xs:float" />
  197.   <xs:attribute name="double" type="xs:double" />
  198.   <xs:attribute name="duration" type="xs:duration" />
  199.   <xs:attribute name="dateTime" type="xs:dateTime" />
  200.   <xs:attribute name="time" type="xs:time" />
  201.   <xs:attribute name="date" type="xs:date" />
  202.   <xs:attribute name="gYearMonth" type="xs:gYearMonth" />
  203.   <xs:attribute name="gYear" type="xs:gYear" />
  204.   <xs:attribute name="gMonthDay" type="xs:gMonthDay" />
  205.   <xs:attribute name="gDay" type="xs:gDay" />
  206.   <xs:attribute name="gMonth" type="xs:gMonth" />
  207.   <xs:attribute name="hexBinary" type="xs:hexBinary" />
  208.   <xs:attribute name="base64Binary" type="xs:base64Binary" />
  209.   <xs:attribute name="anyURI" type="xs:anyURI" />
  210.   <xs:attribute name="QName" type="xs:QName" />
  211.   <xs:attribute name="normalizedString" type="xs:normalizedString" />
  212.   <xs:attribute name="token" type="xs:token" />
  213.   <xs:attribute name="language" type="xs:language" />
  214.   <xs:attribute name="NMTOKEN" type="xs:NMTOKEN" />
  215.   <xs:attribute name="NMTOKENS" type="xs:NMTOKENS" />
  216.   <xs:attribute name="Name" type="xs:Name" />
  217.   <xs:attribute name="NCName" type="xs:NCName" />
  218.   <xs:attribute name="ID" type="xs:ID" />
  219.   <xs:attribute name="IDREF" type="xs:IDREF" />
  220.   <xs:attribute name="IDREFS" type="xs:IDREFS" />
  221.   <xs:attribute name="ENTITY" type="xs:ENTITY" />
  222.   <xs:attribute name="ENTITIES" type="xs:ENTITIES" />
  223.   <xs:attribute name="integer" type="xs:integer" />
  224.   <xs:attribute name="nonPositiveInteger" type="xs:nonPositiveInteger" />
  225.   <xs:attribute name="negativeInteger" type="xs:negativeInteger" />
  226.   <xs:attribute name="long" type="xs:long" />
  227.   <xs:attribute name="int" type="xs:int" />
  228.   <xs:attribute name="short" type="xs:short" />
  229.   <xs:attribute name="byte" type="xs:byte" />
  230.   <xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" />
  231.   <xs:attribute name="unsignedLong" type="xs:unsignedLong" />
  232.   <xs:attribute name="unsignedInt" type="xs:unsignedInt" />
  233.   <xs:attribute name="unsignedShort" type="xs:unsignedShort" />
  234.   <xs:attribute name="unsignedByte" type="xs:unsignedByte" />
  235.   <xs:attribute name="positiveInteger" type="xs:positiveInteger" />
  236.   <xs:attribute name="defaultString" type="xs:string" default="hello" />
  237.   <xs:attribute name="defaultInt" type="xs:integer" default="12" />
  238. </xs:complexType>
  239. <xs:complexType name="simpleDerTestType" >
  240.   <xs:sequence>
  241.     <xs:element name="decimalDerived" type="decimalDerivedType" />
  242.     <xs:element name="stringDerived" type="stringDerivedType" />
  243.   </xs:sequence>
  244.   <xs:attribute name="decimalDerived" type="decimalDerivedType" />
  245.   <xs:attribute name="stringDerived" type="stringDerivedType" />
  246. </xs:complexType>
  247. <xs:simpleType name="stringDerivedType" >
  248.   <xs:restriction base="xs:string" >
  249.     <xs:pattern value="hello"/>
  250.   </xs:restriction>
  251. </xs:simpleType>
  252. <xs:simpleType name="decimalDerivedType" >
  253.   <xs:restriction base="xs:decimal" >
  254.     <xs:maxExclusive value="100"/>
  255.   </xs:restriction>
  256. </xs:simpleType>
  257. <xs:complexType name="complexTestType" >
  258.   <xs:sequence>
  259.     <xs:element name="a" type="xs:string"/>
  260.     <xs:element name="b" type="stringDerivedType"/>
  261.     <xs:element name="c" type="decimalDerivedType"/>
  262.   </xs:sequence>
  263.   <xs:attribute name="a" type="xs:string" />
  264.   <xs:attribute name="b" type="stringDerivedType" />
  265.   <xs:attribute name="c" type="decimalDerivedType" />
  266. </xs:complexType>
  267. <xs:complexType name="complexDerTestType" >
  268.   <xs:complexContent >
  269.     <xs:extension base="complexTestType" >
  270.       <xs:sequence>
  271.         <xs:element name="d" type="xs:string"/>
  272.       </xs:sequence>
  273.     </xs:extension>
  274.   </xs:complexContent>
  275. </xs:complexType>
  276. <xs:simpleType name="unionTestType" >
  277.   <xs:union memberTypes="decimalDerivedType stringDerivedType xs:decimal xs:string" />
  278. </xs:simpleType>
  279. <xs:complexType name="unionTest" >
  280.   <xs:sequence >
  281.     <xs:element name="testEle" maxOccurs="4"  type="unionTestType" />
  282.     <xs:element name="testEle2" maxOccurs="4" >
  283.       <xs:complexType >
  284.          <xs:attribute name="testAttr" type="unionTestType" />
  285.          <xs:attribute name="testAttr2" type="unionTestType" />
  286.       </xs:complexType>
  287.     </xs:element>
  288.   </xs:sequence>
  289. </xs:complexType>
  290. <xs:complexType name="unionTest2" >
  291.   <xs:sequence >
  292.     <xs:element name="testEle" maxOccurs="4"  >
  293.       <xs:complexType >
  294.         <xs:simpleContent >
  295.           <xs:extension base="unionTestType" >
  296.             <xs:attribute name="testAttr" type="unionTestType" />
  297.           </xs:extension >
  298.         </xs:simpleContent>
  299.       </xs:complexType>
  300.     </xs:element>
  301.   </xs:sequence>
  302. </xs:complexType>
  303. <xs:complexType name="testtype2" >
  304. <xs:sequence>
  305. <xs:element name="poo" type="xs:string"/>
  306. </xs:sequence>
  307. <xs:attribute name="a" type="xs:IDREF" />
  308. <xs:attribute name="b" type="xs:ID" />
  309. <xs:attribute name="c" type="xs:string" />
  310. </xs:complexType>
  311. </xs:schema>