1 | \lstset{language=XML} |
---|
2 | \begin{lstlisting}[label=lst:cmd-schema, caption={general-component-schema.xsd -- schema of the CMD meta model for defining CMD profiles and components}] |
---|
3 | <?xml version="1.0" encoding="UTF-8"?> |
---|
4 | <!-- $Revision: 2517 $ |
---|
5 | $Date: 2013-01-30 16:29:31 +0100 (Wed, 30 Jan 2013) $ |
---|
6 | --> |
---|
7 | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
---|
8 | <xs:import namespace="http://www.w3.org/XML/1998/namespace" |
---|
9 | schemaLocation="http://www.w3.org/2005/08/xml.xsd"/> |
---|
10 | |
---|
11 | <!-- root element --> |
---|
12 | <xs:element name="CMD_ComponentSpec"> |
---|
13 | <xs:complexType> |
---|
14 | <xs:sequence> |
---|
15 | <xs:element name="Header"> |
---|
16 | <xs:complexType> |
---|
17 | <xs:sequence> |
---|
18 | <xs:element name="ID" type="xs:anyURI" minOccurs="0"/> |
---|
19 | <xs:element name="Name" type="xs:string" minOccurs="0"/> |
---|
20 | <xs:element name="Description" type="xs:string" minOccurs="0"/> |
---|
21 | </xs:sequence> |
---|
22 | </xs:complexType> |
---|
23 | </xs:element> |
---|
24 | <xs:element name="CMD_Component" type="CMD_Component_type" maxOccurs="unbounded"> |
---|
25 | <xs:annotation> |
---|
26 | <xs:documentation>At the root level there should always be a |
---|
27 | Component.</xs:documentation> |
---|
28 | </xs:annotation> |
---|
29 | </xs:element> |
---|
30 | </xs:sequence> |
---|
31 | <xs:attribute name="isProfile" type="xs:boolean" use="required"/> |
---|
32 | </xs:complexType> |
---|
33 | </xs:element> |
---|
34 | |
---|
35 | <!-- recursive construction: A component can contain elements and/or other components --> |
---|
36 | <xs:group name="group"> |
---|
37 | <xs:sequence> |
---|
38 | <!-- from small (attribute) to big (component) --> |
---|
39 | <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"/> |
---|
40 | <xs:element name="CMD_Element" type="CMD_Element_type" minOccurs="0" |
---|
41 | maxOccurs="unbounded"> </xs:element> |
---|
42 | <xs:element name="CMD_Component" type="CMD_Component_type" minOccurs="0" |
---|
43 | maxOccurs="unbounded"/> |
---|
44 | </xs:sequence> |
---|
45 | </xs:group> |
---|
46 | |
---|
47 | <!-- type definitions --> |
---|
48 | <xs:complexType name="CMD_Element_type"> |
---|
49 | <xs:sequence> |
---|
50 | <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"> |
---|
51 | <xs:annotation> |
---|
52 | <xs:documentation>The AttributeList child of an element contains a set of XML |
---|
53 | attributes for that element.</xs:documentation> |
---|
54 | </xs:annotation> |
---|
55 | </xs:element> |
---|
56 | <xs:element minOccurs="0" maxOccurs="1" name="ValueScheme" type="ValueScheme_type"> |
---|
57 | <xs:annotation> |
---|
58 | <xs:documentation>When an element is linked to a regular expression or a |
---|
59 | controlled vocabulary, the ValueScheme sub-element contains more information |
---|
60 | about this.</xs:documentation> |
---|
61 | </xs:annotation> |
---|
62 | </xs:element> |
---|
63 | </xs:sequence> |
---|
64 | <xs:attributeGroup ref="clarin_element_attributes"/> |
---|
65 | </xs:complexType> |
---|
66 | |
---|
67 | <xs:complexType name="ValueScheme_type"> |
---|
68 | <xs:choice> |
---|
69 | <xs:element name="pattern" type="xs:string" maxOccurs="1"> |
---|
70 | <xs:annotation> |
---|
71 | <xs:documentation>Specification of a regular expression the element should |
---|
72 | comply with.</xs:documentation> |
---|
73 | </xs:annotation> |
---|
74 | </xs:element> |
---|
75 | <xs:element name="enumeration" type="enumeration_type"> |
---|
76 | <xs:annotation> |
---|
77 | <xs:documentation>A list of the allowed values of a controlled |
---|
78 | vocabulary.</xs:documentation> |
---|
79 | </xs:annotation> |
---|
80 | </xs:element> |
---|
81 | </xs:choice> |
---|
82 | </xs:complexType> |
---|
83 | |
---|
84 | <xs:complexType name="AttributeList_type"> |
---|
85 | <xs:sequence> |
---|
86 | <xs:element name="Attribute" minOccurs="1" maxOccurs="unbounded"> |
---|
87 | <xs:complexType> |
---|
88 | <xs:sequence> |
---|
89 | <xs:element name="Name" type="xs:string"> |
---|
90 | <xs:annotation> |
---|
91 | <xs:documentation>The name of the attribute.</xs:documentation> |
---|
92 | </xs:annotation> |
---|
93 | </xs:element> |
---|
94 | <xs:element name="ConceptLink" type="xs:anyURI" minOccurs="0"> |
---|
95 | <xs:annotation> |
---|
96 | <xs:documentation>A link to the ISOcat data category registry (or |
---|
97 | any other concept registry).</xs:documentation> |
---|
98 | </xs:annotation> |
---|
99 | </xs:element> |
---|
100 | <xs:choice> |
---|
101 | <xs:element name="Type" type="allowed_attributetypes_type"> |
---|
102 | <xs:annotation> |
---|
103 | <xs:documentation>For the use of simple XML types as the type of |
---|
104 | the attribute.</xs:documentation> |
---|
105 | </xs:annotation> |
---|
106 | </xs:element> |
---|
107 | <xs:element name="ValueScheme" type="ValueScheme_type"> |
---|
108 | <xs:annotation> |
---|
109 | <xs:documentation>For the use of a regular expression or a |
---|
110 | controlled vocabulary as the type of the |
---|
111 | attribute.</xs:documentation> |
---|
112 | </xs:annotation> |
---|
113 | </xs:element> |
---|
114 | </xs:choice> |
---|
115 | </xs:sequence> |
---|
116 | </xs:complexType> |
---|
117 | </xs:element> |
---|
118 | </xs:sequence> |
---|
119 | </xs:complexType> |
---|
120 | |
---|
121 | <xs:complexType name="CMD_Component_type"> |
---|
122 | <xs:group ref="group" minOccurs="0"/> |
---|
123 | <xs:attributeGroup ref="clarin_component_attributes"/> |
---|
124 | </xs:complexType> |
---|
125 | |
---|
126 | <!-- list of all attributes that can be bound to a cl_el --> |
---|
127 | <xs:attributeGroup name="clarin_element_attributes"> |
---|
128 | <xs:attribute name="name" type="xs:Name" use="required"> |
---|
129 | <xs:annotation> |
---|
130 | <xs:documentation>The name of the element.</xs:documentation> |
---|
131 | </xs:annotation> |
---|
132 | </xs:attribute> |
---|
133 | <xs:attribute name="ConceptLink" type="xs:anyURI"> |
---|
134 | <xs:annotation> |
---|
135 | <xs:documentation>A link to the ISOcat data category registry (or any other concept |
---|
136 | registry).</xs:documentation> |
---|
137 | </xs:annotation> |
---|
138 | </xs:attribute> |
---|
139 | <xs:attribute name="ValueScheme" type="allowed_attributetypes_type"> |
---|
140 | <xs:annotation> |
---|
141 | <xs:documentation>Used to specify that an element has a simple XML type (string, |
---|
142 | integer, etc)</xs:documentation> |
---|
143 | </xs:annotation> |
---|
144 | </xs:attribute> |
---|
145 | <xs:attribute name="CardinalityMin" type="cardinality_type"> |
---|
146 | <xs:annotation> |
---|
147 | <xs:documentation>Minimal number of occurrences.</xs:documentation> |
---|
148 | </xs:annotation> |
---|
149 | </xs:attribute> |
---|
150 | <xs:attribute name="CardinalityMax" type="cardinality_type"> |
---|
151 | <xs:annotation> |
---|
152 | <xs:documentation>Maximal number of occurrences.</xs:documentation> |
---|
153 | </xs:annotation> |
---|
154 | </xs:attribute> |
---|
155 | <xs:attribute name="Documentation" type="xs:string"> |
---|
156 | <xs:annotation> |
---|
157 | <xs:documentation>Some information an application (eg Arbil) can display to give |
---|
158 | guidance to the user when entering metadata.</xs:documentation> |
---|
159 | </xs:annotation> |
---|
160 | </xs:attribute> |
---|
161 | <xs:attribute name="DisplayPriority" type="xs:integer"> |
---|
162 | <xs:annotation> |
---|
163 | <xs:documentation>The element with the highest priority will be displayed as the |
---|
164 | label for a metadata file (eg in Arbil)</xs:documentation> |
---|
165 | </xs:annotation> |
---|
166 | </xs:attribute> |
---|
167 | <xs:attribute name="Multilingual" type="xs:boolean"> |
---|
168 | <xs:annotation> |
---|
169 | <xs:documentation>Indicates that this element can have values in multiple languages |
---|
170 | (and thus is repeatable). This will result in the possibility of using the |
---|
171 | xml:lang attribute in the metadata instances that are |
---|
172 | created.</xs:documentation> |
---|
173 | </xs:annotation> |
---|
174 | </xs:attribute> |
---|
175 | </xs:attributeGroup> |
---|
176 | |
---|
177 | <!-- list of all attributes that can be bound to a cl_comp --> |
---|
178 | <xs:attributeGroup name="clarin_component_attributes"> |
---|
179 | <xs:attribute name="name" type="xs:Name"/> |
---|
180 | <xs:attribute name="ComponentId" type="xs:anyURI"> |
---|
181 | <xs:annotation> |
---|
182 | <xs:documentation>Indicates that a component (using its unique ComponentId issued by |
---|
183 | the ComponentRegistry) should be included.</xs:documentation> |
---|
184 | </xs:annotation> |
---|
185 | </xs:attribute> |
---|
186 | <xs:attribute name="ConceptLink" type="xs:anyURI"> |
---|
187 | <xs:annotation> |
---|
188 | <xs:documentation>A link to the ISOcat data category registry (or any other concept |
---|
189 | registry). Currently not used.</xs:documentation> |
---|
190 | </xs:annotation> |
---|
191 | </xs:attribute> |
---|
192 | <xs:attribute name="filename" type="xs:anyURI"> |
---|
193 | <xs:annotation> |
---|
194 | <xs:documentation>Outdated way of including an external component. Here for backward |
---|
195 | compatibility with the XML-cmdi-toolkit.</xs:documentation> |
---|
196 | </xs:annotation> |
---|
197 | </xs:attribute> |
---|
198 | |
---|
199 | <!-- (components cannot have a ValueScheme attribute) --> |
---|
200 | |
---|
201 | <xs:attribute name="CardinalityMin" type="cardinality_type"/> |
---|
202 | <xs:attribute name="CardinalityMax" type="cardinality_type"/> |
---|
203 | <xs:attribute ref="xml:base"/> |
---|
204 | </xs:attributeGroup> |
---|
205 | |
---|
206 | <xs:simpleType name="cardinality_type"> |
---|
207 | <xs:annotation> |
---|
208 | <xs:documentation>cardinality for elements and components</xs:documentation> |
---|
209 | </xs:annotation> |
---|
210 | <xs:union> |
---|
211 | <xs:simpleType> |
---|
212 | <xs:list itemType="xs:nonNegativeInteger"/> |
---|
213 | </xs:simpleType> |
---|
214 | <xs:simpleType> |
---|
215 | <xs:restriction base="xs:string"> |
---|
216 | <xs:enumeration value="unbounded"/> |
---|
217 | </xs:restriction> |
---|
218 | </xs:simpleType> |
---|
219 | </xs:union> |
---|
220 | </xs:simpleType> |
---|
221 | |
---|
222 | <xs:simpleType name="allowed_attributetypes_type"> |
---|
223 | <xs:annotation> |
---|
224 | <xs:documentation>Subset of XSD types that are allowed as CMD type</xs:documentation> |
---|
225 | </xs:annotation> |
---|
226 | |
---|
227 | <xs:restriction base="xs:token"> |
---|
228 | <xs:enumeration value="boolean"/> |
---|
229 | <xs:enumeration value="decimal"/> |
---|
230 | <xs:enumeration value="float"/> |
---|
231 | <xs:enumeration value="int"/> |
---|
232 | <xs:enumeration value="string"/> |
---|
233 | <xs:enumeration value="anyURI"/> |
---|
234 | <xs:enumeration value="date"/> |
---|
235 | <xs:enumeration value="gDay"/> |
---|
236 | <xs:enumeration value="gMonth"/> |
---|
237 | <xs:enumeration value="gYear"/> |
---|
238 | <xs:enumeration value="time"/> |
---|
239 | <xs:enumeration value="dateTime"/> |
---|
240 | </xs:restriction> |
---|
241 | </xs:simpleType> |
---|
242 | |
---|
243 | <xs:complexType name="enumeration_type"> |
---|
244 | <xs:annotation> |
---|
245 | <xs:documentation>controlled vocabularies</xs:documentation> |
---|
246 | </xs:annotation> |
---|
247 | <xs:choice minOccurs="0" maxOccurs="unbounded"> |
---|
248 | <xs:element name="item" type="item_type"> |
---|
249 | <xs:annotation> |
---|
250 | <xs:documentation>An item from a controlled vocabulary.</xs:documentation> |
---|
251 | </xs:annotation> |
---|
252 | </xs:element> |
---|
253 | <xs:element name="appinfo" type="xs:string"> |
---|
254 | <xs:annotation> |
---|
255 | <xs:documentation>End-user guidance about the value of the controlled vocabulary |
---|
256 | as a whole. Currently not used.</xs:documentation> |
---|
257 | </xs:annotation> |
---|
258 | </xs:element> |
---|
259 | </xs:choice> |
---|
260 | </xs:complexType> |
---|
261 | |
---|
262 | <xs:complexType name="item_type"> |
---|
263 | <xs:simpleContent> |
---|
264 | <xs:extension base="xs:string"> |
---|
265 | <xs:attribute type="xs:anyURI" name="ConceptLink"> |
---|
266 | <xs:annotation> |
---|
267 | <xs:documentation>A link to the ISOcat data category registry (or any other |
---|
268 | concept registry) related to this controllec vocabulary |
---|
269 | item.</xs:documentation> |
---|
270 | </xs:annotation> |
---|
271 | </xs:attribute> |
---|
272 | <xs:attribute type="xs:string" name="AppInfo"> |
---|
273 | <xs:annotation> |
---|
274 | <xs:documentation>End-user guidance about the value of this controlled |
---|
275 | vocabulary item.</xs:documentation> |
---|
276 | </xs:annotation> |
---|
277 | </xs:attribute> |
---|
278 | </xs:extension> |
---|
279 | </xs:simpleContent> |
---|
280 | </xs:complexType> |
---|
281 | </xs:schema> |
---|
282 | \end{lstlisting} |
---|