Changeset 5628 for metadata/trunk/toolkit/xsd/cmd-component.xsd
- Timestamp:
- 09/15/14 10:21:49 (10 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
metadata/trunk/toolkit/xsd/cmd-component.xsd
r5617 r5628 11 11 12 12 <!-- root element --> 13 <xs:element name="CMD_ComponentSpec"> 13 <xs:element name="ComponentSpec"> 14 <xs:annotation> 15 <xs:appinfo> 16 <sch:pattern id="h_succ"> 17 <sch:title>Check successor</sch:title> 18 <sch:rule context="Header/Successor"> 19 <sch:assert test="../Status='deprecated'">There can only be a successor component/profile if the status of this component/profile is deprecated!</sch:assert> 20 </sch:rule> 21 </sch:pattern> 22 <sch:pattern id="r_card"> 23 <sch:title>Cardinality root component</sch:title> 24 <sch:rule context="ComponentSpec/Component"> 25 <sch:assert test="empty(@CardinalityMin) or @CardinalityMin='1'">The minimum cardinality of the root component should be 1!</sch:assert> 26 <sch:assert test="empty(@CardinalityMax) or @CardinalityMax='1'">The maximum cardinality of the root component should be 1!</sch:assert> 27 </sch:rule> 28 </sch:pattern> 29 </xs:appinfo> 30 </xs:annotation> 14 31 <xs:complexType> 15 32 <xs:sequence> … … 20 37 <xs:element name="Name" type="xs:string" minOccurs="0"/> 21 38 <xs:element name="Description" type="xs:string" minOccurs="0"/> 39 <!-- status information --> 40 <xs:element name="Status" minOccurs="1" maxOccurs="1"> 41 <xs:simpleType> 42 <xs:restriction base="xs:string"> 43 <xs:enumeration value="development"/> 44 <xs:enumeration value="production"/> 45 <xs:enumeration value="deprecated"/> 46 </xs:restriction> 47 </xs:simpleType> 48 </xs:element> 49 <xs:element name="StatusComment" type="xs:string" minOccurs="0" maxOccurs="1"/> 50 <xs:element name="Successor" type="xs:anyURI" minOccurs="0" maxOccurs="1"/> 22 51 </xs:sequence> 23 52 </xs:complexType> 24 53 </xs:element> 25 <xs:element name="C MD_Component" type="CMD_Component_type">54 <xs:element name="Component" type="Component_type"> 26 55 <xs:annotation> 27 56 <xs:documentation>At the root level there should always be a … … 40 69 <sch:pattern id="c_sibs"> 41 70 <sch:title>Check siblings</sch:title> 42 <sch:rule context="C MD_Component|CMD_Element">71 <sch:rule context="Component|Element"> 43 72 <sch:assert test="empty(preceding-sibling::*[@name=current()/@name])">Sibling components or elements should all have a different name. Found multiple components or elements named '<sch:value-of select="@name"/>'!</sch:assert> 44 73 </sch:rule> … … 46 75 <sch:pattern id="c_csibs"> 47 76 <sch:title>Check component siblings</sch:title> 48 <sch:rule context="C MD_Component">49 <sch:assert test="empty(preceding-sibling::C MD_Component[@ComponentId=current()/@ComponentId])">Sibling components should all be different. Found multiple components with id '<sch:value-of select="@ComponentId"/>'!</sch:assert>50 </sch:rule> 51 </sch:pattern> 52 <!-- TODO: the names of referenced external components are not known, so we can't currently checktwo or more of them use the same name -->77 <sch:rule context="Component"> 78 <sch:assert test="empty(preceding-sibling::Component[@ComponentId=current()/@ComponentId])">Sibling components should all be different. Found multiple components with id '<sch:value-of select="@ComponentId"/>'!</sch:assert> 79 </sch:rule> 80 </sch:pattern> 81 <!-- TODO: check: the names of referenced external components are not known, so we can't currently check if two or more of them use the same name --> 53 82 <sch:pattern id="c_nest"> 54 83 <sch:title>Check nesting</sch:title> 55 <sch:rule context="C MD_Component[exists(CMD_Component|CMD_Element)]" role="warning">56 <sch:assert test="empty((C MD_Component|CMD_Element)[@name=current()/@name])">A nested component or element has the same name ('<sch:value-of select="@name"/>') as this component! Please, consider to rename one of them.</sch:assert>57 </sch:rule> 58 </sch:pattern> 59 </xs:appinfo> 84 <sch:rule context="Component[exists(Component|Element)]" role="warning"> 85 <sch:assert test="empty((Component|Element)[@name=current()/@name])">A nested component or element has the same name ('<sch:value-of select="@name"/>') as this component! Please, consider to rename one of them.</sch:assert> 86 </sch:rule> 87 </sch:pattern> 88 </xs:appinfo> 60 89 </xs:annotation> 61 90 <xs:sequence> 91 <xs:element name="Documentation" type="Documentation_type" minOccurs="0" maxOccurs="unbounded"/> 62 92 <!-- from small (attribute) to big (component) --> 63 93 <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"/> 64 <xs:element name=" CMD_Element" type="CMD_Element_type" minOccurs="0"94 <xs:element name="Element" type="Element_type" minOccurs="0" 65 95 maxOccurs="unbounded"> </xs:element> 66 <xs:element name="C MD_Component" type="CMD_Component_type" minOccurs="0"96 <xs:element name="Component" type="Component_type" minOccurs="0" 67 97 maxOccurs="unbounded"/> 68 98 </xs:sequence> … … 70 100 71 101 <!-- type definitions --> 72 <xs:complexType name="CMD_Element_type"> 102 <xs:complexType name="Documentation_type"> 103 <xs:annotation> 104 <xs:documentation>Some information an application (eg Arbil) can display to give 105 guidance to the user when entering metadata.</xs:documentation> 106 <xs:appinfo> 107 <sch:pattern id="d_dsibs"> 108 <sch:title>Check Documentation siblings</sch:title> 109 <sch:rule context="Documentation"> 110 <sch:assert test="empty(preceding-sibling::Documentation[@xml:lang=current()/@xml:lang])">Sibling Documentation elements should all be for different languages. Found multiple Documentation elements with xml:lang '<sch:value-of select="@xml:lang"/>'!</sch:assert> 111 </sch:rule> 112 </sch:pattern> 113 </xs:appinfo> 114 </xs:annotation> 115 <xs:simpleContent> 116 <xs:extension base="xs:string"> 117 <xs:attribute ref="xml:lang" use="optional"/> 118 </xs:extension> 119 </xs:simpleContent> 120 </xs:complexType> 121 122 <xs:complexType name="Element_type"> 123 <xs:annotation> 124 <xs:appinfo> 125 <sch:pattern id="e_vs"> 126 <sch:title>Check Element ValueScheme</sch:title> 127 <sch:rule context="Element"> 128 <sch:assert test="exists(@ValueScheme) or exists(ValueScheme)">An Element must have either a @ValueScheme or a ./ValueScheme!</sch:assert> 129 </sch:rule> 130 </sch:pattern> 131 </xs:appinfo> 132 </xs:annotation> 73 133 <xs:sequence> 134 <xs:element name="Documentation" type="Documentation_type" minOccurs="0" maxOccurs="unbounded"/> 74 135 <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"> 75 136 <xs:annotation> … … 85 146 </xs:annotation> 86 147 </xs:element> 148 <xs:element name="AutoValue" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> 87 149 </xs:sequence> 88 <xs:attributeGroup ref="clarin_element_attributes"/> 89 </xs:complexType> 90 150 <xs:attributeGroup ref="element_attributes"/> 151 </xs:complexType> 91 152 92 153 <xs:complexType name="ValueScheme_type"> 154 <xs:annotation> 155 <xs:appinfo> 156 <sch:pattern id="v_uri"> 157 <sch:title>Check Vocabulary URI</sch:title> 158 <sch:rule context="Vocabulary[exists(@URI)]"> 159 <sch:assert test="exists(@ValueProperty)">When an external vocabulary (identified by the @URI) a @ValueProperty has to be specified!</sch:assert> 160 </sch:rule> 161 </sch:pattern> 162 </xs:appinfo> 163 </xs:annotation> 93 164 <xs:choice> 94 165 <xs:element name="pattern" type="xs:string" maxOccurs="1"> … … 98 169 </xs:annotation> 99 170 </xs:element> 100 <xs:element name="enumeration" type="enumeration_type"> 101 <xs:annotation> 102 <xs:documentation>A list of the allowed values of a controlled 103 vocabulary.</xs:documentation> 171 <xs:element name="Vocabulary" type="Vocabulary_type"> 172 <xs:annotation> 173 <xs:documentation>Specification of an open or closed vocabulary</xs:documentation> 104 174 </xs:annotation> 105 175 </xs:element> … … 107 177 </xs:complexType> 108 178 179 <xs:complexType name="Vocabulary_type"> 180 <xs:sequence> 181 <xs:element name="enumeration" type="enumeration_type" minOccurs="0" maxOccurs="1"> 182 <xs:annotation> 183 <xs:documentation>A list of the allowed values of a controlled vocabulary.</xs:documentation> 184 </xs:annotation> 185 </xs:element> 186 </xs:sequence> 187 <xs:attribute name="URI" type="xs:anyURI"/> 188 <!-- optionally selects a label --> 189 <xs:attribute name="ValueProperty" type="xs:string"/> 190 <!-- optionally selects a language --> 191 <xs:attribute name="ValueLanguage" type="xs:language"/> 192 </xs:complexType> 109 193 110 194 <xs:complexType name="AttributeList_type"> 195 <xs:annotation> 196 <xs:appinfo> 197 <sch:pattern id="a_vs"> 198 <sch:title>Check Attribute ValueScheme</sch:title> 199 <sch:rule context="Attribute"> 200 <sch:assert test="exists(@ValueScheme) or exists(ValueScheme)">An Attribute must have either a @ValueScheme or a ./ValueScheme!</sch:assert> 201 </sch:rule> 202 </sch:pattern> 203 </xs:appinfo> 204 </xs:annotation> 111 205 <xs:sequence> 112 206 <xs:element name="Attribute" minOccurs="1" maxOccurs="unbounded"> … … 116 210 <sch:title>Check reserved attribute names</sch:title> 117 211 <sch:rule context="Attribute"> 118 <sch:assert test="not( Name=('ref','ComponentId'))">Attribute name shouldn't be 'ref' or 'ComponentId', as these are used internally by CMD!</sch:assert>212 <sch:assert test="not(@name=('ref','ComponentId'))">Attribute name shouldn't be 'ref' or 'ComponentId', as these are used internally by CMD!</sch:assert> 119 213 </sch:rule> 120 214 </sch:pattern> … … 122 216 <sch:title>Check attribute siblings</sch:title> 123 217 <sch:rule context="Attribute"> 124 <sch:assert test="empty(preceding-sibling::Attribute[ Name=current()/Name])">All attributes in an attribute list should have a different name. Found multiple attributes named '<sch:value-of select="Name"/>'!</sch:assert>218 <sch:assert test="empty(preceding-sibling::Attribute[@name=current()/@name])">All attributes in an attribute list should have a different name. Found multiple attributes named '<sch:value-of select="Name"/>'!</sch:assert> 125 219 </sch:rule> 126 220 </sch:pattern> … … 128 222 <sch:title>Check attribute nesting</sch:title> 129 223 <sch:rule context="Attribute" role="warning"> 130 <sch:assert test="empty((ancestor::C MD_Component|ancestor::CMD_Element)[1][@name=current()/Name])">An attribute has the same name ('<sch:value-of select="Name"/>') as its element or component! Please, consider to rename one of them.</sch:assert>224 <sch:assert test="empty((ancestor::Component|ancestor::Element)[1][@name=current()/@ame])">An attribute has the same name ('<sch:value-of select="@name"/>') as its element or component! Please, consider to rename one of them.</sch:assert> 131 225 </sch:rule> 132 226 </sch:pattern> 133 </xs:appinfo> 227 </xs:appinfo> 134 228 </xs:annotation> 135 229 <xs:complexType> 136 230 <xs:sequence> 137 <xs:element name="Name" type="xs:string"> 231 <xs:element name="Documentation" type="Documentation_type" minOccurs="0" maxOccurs="unbounded"/> 232 <xs:element name="ValueScheme" type="ValueScheme_type" minOccurs="0"> 138 233 <xs:annotation> 139 <xs:documentation>The name of the attribute.</xs:documentation> 234 <xs:documentation>For the use of a regular expression or a 235 controlled vocabulary as the type of the 236 attribute.</xs:documentation> 140 237 </xs:annotation> 141 238 </xs:element> 142 <xs:element name="ConceptLink" type="xs:anyURI" minOccurs="0"> 143 <xs:annotation> 144 <xs:documentation>A link to the ISOcat data category registry (or any other concept registry).</xs:documentation> 145 </xs:annotation> 146 </xs:element> 147 <xs:choice> 148 <xs:element name="Type" type="allowed_attributetypes_type"> 149 <xs:annotation> 150 <xs:documentation>For the use of simple XML types as the type of 151 the attribute.</xs:documentation> 152 </xs:annotation> 153 </xs:element> 154 <xs:element name="ValueScheme" type="ValueScheme_type"> 155 <xs:annotation> 156 <xs:documentation>For the use of a regular expression or a 157 controlled vocabulary as the type of the 158 attribute.</xs:documentation> 159 </xs:annotation> 160 </xs:element> 161 </xs:choice> 239 <xs:element name="AutoValue" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> 162 240 </xs:sequence> 241 <xs:attributeGroup ref="attribute_attributes"/> 163 242 </xs:complexType> 164 243 </xs:element> … … 166 245 </xs:complexType> 167 246 168 <xs:complexType name="C MD_Component_type">247 <xs:complexType name="Component_type"> 169 248 <xs:group ref="group" minOccurs="0"/> 170 <xs:attributeGroup ref="clarin_component_attributes"/> 171 </xs:complexType> 172 173 174 <!-- list of all attributes that can be bound to a cl_el --> 175 <xs:attributeGroup name="clarin_element_attributes"> 249 <xs:attributeGroup ref="component_attributes"/> 250 </xs:complexType> 251 252 <xs:attributeGroup name="attribute_attributes"> 176 253 <xs:attribute name="name" type="xs:Name" use="required"> 177 254 <xs:annotation> 178 <xs:documentation>The name of the element.</xs:documentation>255 <xs:documentation>The name of the attribute.</xs:documentation> 179 256 </xs:annotation> 180 257 </xs:attribute> … … 187 264 <xs:attribute name="ValueScheme" type="allowed_attributetypes_type"> 188 265 <xs:annotation> 266 <xs:documentation>For the use of simple XML types as the type of 267 the attribute.</xs:documentation> 268 </xs:annotation> 269 </xs:attribute> 270 <xs:attribute name="Required" type="xs:boolean"> 271 <xs:annotation> 272 <xs:documentation>Is the attribute required or not?</xs:documentation> 273 </xs:annotation> 274 </xs:attribute> 275 <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/> 276 </xs:attributeGroup> 277 278 <xs:attributeGroup name="element_attributes"> 279 <xs:attribute name="name" type="xs:Name" use="required"> 280 <xs:annotation> 281 <xs:documentation>The name of the element.</xs:documentation> 282 </xs:annotation> 283 </xs:attribute> 284 <xs:attribute name="ConceptLink" type="xs:anyURI"> 285 <xs:annotation> 286 <xs:documentation>A link to the ISOcat data category registry (or any other concept 287 registry).</xs:documentation> 288 </xs:annotation> 289 </xs:attribute> 290 <xs:attribute name="ValueScheme" type="allowed_attributetypes_type"> 291 <xs:annotation> 189 292 <xs:documentation>Used to specify that an element has a simple XML type (string, 190 293 integer, etc)</xs:documentation> … … 199 302 <xs:annotation> 200 303 <xs:documentation>Maximal number of occurrences.</xs:documentation> 201 </xs:annotation>202 </xs:attribute>203 <xs:attribute name="Documentation" type="xs:string">204 <xs:annotation>205 <xs:documentation>Some information an application (eg Arbil) can display to give206 guidance to the user when entering metadata.</xs:documentation>207 </xs:annotation>208 </xs:attribute>209 <xs:attribute name="DisplayPriority" type="xs:integer">210 <xs:annotation>211 <xs:documentation>The element with the highest priority will be displayed as the212 label for a metadata file (eg in Arbil)</xs:documentation>213 304 </xs:annotation> 214 305 </xs:attribute> … … 221 312 </xs:annotation> 222 313 </xs:attribute> 314 <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/> 223 315 </xs:attributeGroup> 224 316 225 <!-- list of all attributes that can be bound to a cl_comp --> 226 <xs:attributeGroup name="clarin_component_attributes"> 317 <xs:attributeGroup name="component_attributes"> 227 318 <xs:attribute name="name" type="xs:Name"/> 228 319 <xs:attribute name="ComponentId" type="xs:anyURI"> … … 238 329 </xs:annotation> 239 330 </xs:attribute> 240 <xs:attribute name="filename" type="xs:anyURI">241 <xs:annotation>242 <xs:documentation>Outdated way of including an external component. Here for backward243 compatibility with the XML-cmdi-toolkit.</xs:documentation>244 </xs:annotation>245 </xs:attribute>246 247 <!-- (components cannot have a ValueScheme attribute) -->248 249 331 <xs:attribute name="CardinalityMin" type="cardinality_type"/> 250 332 <xs:attribute name="CardinalityMax" type="cardinality_type"/> 251 333 <xs:attribute ref="xml:base"/> 334 <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/> 252 335 </xs:attributeGroup> 253 336 … … 381 464 </xs:annotation> 382 465 </xs:attribute> 466 <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/display/1.0" processContents="lax"/> 383 467 </xs:extension> 384 468 </xs:simpleContent>
Note: See TracChangeset
for help on using the changeset viewer.