blob: c768e97e0ba885108bce9b42cfc13d532e4a85e0 [file] [log] [blame]
Daniel Veillardbe9c6322003-11-22 20:37:51 +00001<?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
5 <xs:simpleType name="string255">
6 <xs:restriction base="xs:token">
7 <xs:maxLength value="255"/>
8 </xs:restriction>
9 </xs:simpleType>
10 <xs:simpleType name="string32">
11 <xs:restriction base="xs:token">
12 <xs:maxLength value="32"/>
13 </xs:restriction>
14 </xs:simpleType>
15 <xs:simpleType name="isbn">
16 <xs:restriction base="xs:unsignedLong">
17 <xs:totalDigits value="10"/>
18 </xs:restriction>
19 </xs:simpleType>
20 <xs:simpleType name="supportedLanguages">
21 <xs:restriction base="xs:language">
22 <xs:enumeration value="en"/>
23 <xs:enumeration value="es"/>
24 </xs:restriction>
25 </xs:simpleType>
26 <xs:element name="name" type="string32"/>
27 <xs:element name="qualification" type="string255"/>
28 <xs:element name="born" type="xs:date"/>
29 <xs:element name="dead" type="xs:date"/>
30 <xs:element name="isbn" type="isbn"/>
31
32 <xs:attribute name="id" type="xs:ID"/>
33 <xs:attribute name="available" type="xs:boolean"/>
34 <xs:attribute name="lang" type="supportedLanguages"/>
35
36 <xs:element name="title">
37 <xs:complexType>
38 <xs:simpleContent>
39 <xs:extension base="string255">
40 <xs:attribute ref="lang"/>
41 </xs:extension>
42 </xs:simpleContent>
43 </xs:complexType>
44 </xs:element>
45
46 <xs:element name="library">
47 <xs:complexType>
48 <xs:sequence>
49 <xs:element ref="book" maxOccurs="unbounded"/>
50 </xs:sequence>
51 </xs:complexType>
52 </xs:element>
53
54 <xs:element name="author">
55 <xs:complexType>
56 <xs:sequence>
57 <xs:element ref="name"/>
58 <xs:element ref="born"/>
59 <xs:element ref="dead" minOccurs="0"/>
60 </xs:sequence>
61 <xs:attribute ref="id"/>
62 </xs:complexType>
63 </xs:element>
64
65 <xs:element name="book">
66 <xs:complexType>
67 <xs:sequence>
68 <xs:element ref="isbn"/>
69 <xs:element ref="title"/>
70 <xs:element ref="author" minOccurs="0" maxOccurs="unbounded"/>
71 <xs:element ref="character" minOccurs="0" maxOccurs="unbounded"/>
72 </xs:sequence>
73 <xs:attribute ref="id"/>
74 <xs:attribute ref="available"/>
75 </xs:complexType>
76 </xs:element>
77
78 <xs:element name="character">
79 <xs:complexType>
80 <xs:sequence>
81 <xs:element ref="name"/>
82 <xs:element ref="born"/>
83 <xs:element ref="qualification"/>
84 </xs:sequence>
85 <xs:attribute ref="id"/>
86 </xs:complexType>
87 </xs:element>
88
89</xs:schema>