vdv-first2_0.xsd 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- $Header: /home/cvsroot/w3c-xml-schema/user/examples/first-user-dt.xsd,v 1.1 2001/11/01 12:27:47 vdv Exp $ -->
  3. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  4. <xs:simpleType name="string255">
  5. <xs:restriction base="xs:token">
  6. <xs:maxLength value="255"/>
  7. </xs:restriction>
  8. </xs:simpleType>
  9. <xs:simpleType name="string32">
  10. <xs:restriction base="xs:token">
  11. <xs:maxLength value="32"/>
  12. </xs:restriction>
  13. </xs:simpleType>
  14. <xs:simpleType name="isbn">
  15. <xs:restriction base="xs:unsignedLong">
  16. <xs:totalDigits value="10"/>
  17. </xs:restriction>
  18. </xs:simpleType>
  19. <xs:simpleType name="supportedLanguages">
  20. <xs:restriction base="xs:language">
  21. <xs:enumeration value="en"/>
  22. <xs:enumeration value="es"/>
  23. </xs:restriction>
  24. </xs:simpleType>
  25. <xs:element name="name" type="string32"/>
  26. <xs:element name="qualification" type="string255"/>
  27. <xs:element name="born" type="xs:date"/>
  28. <xs:element name="dead" type="xs:date"/>
  29. <xs:element name="isbn" type="isbn"/>
  30. <xs:attribute name="id" type="xs:ID"/>
  31. <xs:attribute name="available" type="xs:boolean"/>
  32. <xs:attribute name="lang" type="supportedLanguages"/>
  33. <xs:element name="title">
  34. <xs:complexType>
  35. <xs:simpleContent>
  36. <xs:extension base="string255">
  37. <xs:attribute ref="lang"/>
  38. </xs:extension>
  39. </xs:simpleContent>
  40. </xs:complexType>
  41. </xs:element>
  42. <xs:element name="library">
  43. <xs:complexType>
  44. <xs:sequence>
  45. <xs:element ref="book" maxOccurs="unbounded"/>
  46. </xs:sequence>
  47. </xs:complexType>
  48. </xs:element>
  49. <xs:element name="author">
  50. <xs:complexType>
  51. <xs:sequence>
  52. <xs:element ref="name"/>
  53. <xs:element ref="born"/>
  54. <xs:element ref="dead" minOccurs="0"/>
  55. </xs:sequence>
  56. <xs:attribute ref="id"/>
  57. </xs:complexType>
  58. </xs:element>
  59. <xs:element name="book">
  60. <xs:complexType>
  61. <xs:sequence>
  62. <xs:element ref="isbn"/>
  63. <xs:element ref="title"/>
  64. <xs:element ref="author" minOccurs="0" maxOccurs="unbounded"/>
  65. <xs:element ref="character" minOccurs="0" maxOccurs="unbounded"/>
  66. </xs:sequence>
  67. <xs:attribute ref="id"/>
  68. <xs:attribute ref="available"/>
  69. </xs:complexType>
  70. </xs:element>
  71. <xs:element name="character">
  72. <xs:complexType>
  73. <xs:sequence>
  74. <xs:element ref="name"/>
  75. <xs:element ref="born"/>
  76. <xs:element ref="qualification"/>
  77. </xs:sequence>
  78. <xs:attribute ref="id"/>
  79. </xs:complexType>
  80. </xs:element>
  81. </xs:schema>