Changeset 4525
- Timestamp:
- 02/17/14 11:01:30 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
metadata/trunk/toolkit/general-component-schema.xsd
r3893 r4525 5 5 --> 6 6 7 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 7 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://purl.oclc.org/dsdl/schematron"> 8 8 9 <xs:import namespace="http://www.w3.org/XML/1998/namespace" 9 10 schemaLocation="http://www.w3.org/2005/08/xml.xsd"/> … … 22 23 </xs:complexType> 23 24 </xs:element> 24 <xs:element name="CMD_Component" type="CMD_Component_type" maxOccurs="unbounded">25 <xs:element name="CMD_Component" type="CMD_Component_type"> 25 26 <xs:annotation> 26 27 <xs:documentation>At the root level there should always be a … … 35 36 <!-- recursive construction: A component can contain elements and/or other components --> 36 37 <xs:group name="group"> 38 <xs:annotation> 39 <xs:appinfo> 40 <sch:pattern id="c_sibs"> 41 <sch:title>Check siblings</sch:title> 42 <sch:rule context="CMD_Component|CMD_Element"> 43 <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 </sch:rule> 45 </sch:pattern> 46 <sch:pattern id="c_csibs"> 47 <sch:title>Check component siblings</sch:title> 48 <sch:rule context="CMD_Component"> 49 <sch:assert test="empty(preceding-sibling::CMD_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 check two or more of them use the same name --> 53 <sch:pattern id="c_nest"> 54 <sch:title>Check nesting</sch:title> 55 <sch:rule context="CMD_Component[exists(CMD_Component|CMD_Element)]" role="warning"> 56 <sch:assert test="empty((CMD_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> 60 </xs:annotation> 37 61 <xs:sequence> 38 62 <!-- from small (attribute) to big (component) --> … … 87 111 <xs:sequence> 88 112 <xs:element name="Attribute" minOccurs="1" maxOccurs="unbounded"> 113 <xs:annotation> 114 <xs:appinfo> 115 <sch:pattern id="a_res"> 116 <sch:title>Check reserved attribute names</sch:title> 117 <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> 119 </sch:rule> 120 </sch:pattern> 121 <sch:pattern id="a_sibs"> 122 <sch:title>Check attribute siblings</sch:title> 123 <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> 125 </sch:rule> 126 </sch:pattern> 127 <sch:pattern id="a_nest"> 128 <sch:title>Check attribute nesting</sch:title> 129 <sch:rule context="Attribute" role="warning"> 130 <sch:assert test="empty((ancestor::CMD_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> 131 </sch:rule> 132 </sch:pattern> 133 </xs:appinfo> 134 </xs:annotation> 89 135 <xs:complexType> 90 136 <xs:sequence> … … 264 310 265 311 <xs:complexType name="item_type"> 312 <xs:annotation> 313 <xs:appinfo> 314 <sch:pattern id="item"> 315 <sch:title>CMD enumeration item</sch:title> 316 <sch:rule context="item"> 317 <sch:assert test="empty(preceding-sibling::item[.=current()])">All items in an enumeration should be different. Found multiple items with value '<sch:value-of select="."/>'!</sch:assert> 318 </sch:rule> 319 </sch:pattern> 320 </xs:appinfo> 321 </xs:annotation> 266 322 <xs:simpleContent> 267 323 <xs:extension base="xs:string">
Note: See TracChangeset
for help on using the changeset viewer.