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