diff options
author | 2016-03-26 17:40:04 +0100 | |
---|---|---|
committer | 2016-03-26 17:40:04 +0100 | |
commit | b2d68e09fd2e3ac5edfde4049f32a963e261d1f6 (patch) | |
tree | d426b80e558038fb72f64aafc26f45982c6a9ca0 | |
parent | Revert "projects: Allow multi-language descriptions" (diff) | |
download | xml-schema-b2d68e09fd2e3ac5edfde4049f32a963e261d1f6.tar.gz xml-schema-b2d68e09fd2e3ac5edfde4049f32a963e261d1f6.tar.bz2 xml-schema-b2d68e09fd2e3ac5edfde4049f32a963e261d1f6.zip |
projects: Ensure at most one <description/> for each project
-rw-r--r-- | projects.xsd | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/projects.xsd b/projects.xsd index e6f778b..770bd67 100644 --- a/projects.xsd +++ b/projects.xsd @@ -4,7 +4,12 @@ <xs:element name='projects'> <xs:complexType> <xs:choice minOccurs='0' maxOccurs='unbounded'> - <xs:element name='project' type='projectType'/> + <xs:element name='project' type='projectType'> + <xs:unique name='descUniquityConstraint'> + <xs:selector xpath='description'/> + <xs:field xpath='@fake-only-once'/> + </xs:unique> + </xs:element> </xs:choice> </xs:complexType> <xs:key name='projectKey'> @@ -32,12 +37,21 @@ <xs:element name='email' type='emailType'/> <xs:element name='name' type='xs:token'/> <xs:element name='url' type='urlType'/> - <xs:element name='description' type='xs:token'/> + <xs:element name='description' type='descriptionType'/> <xs:element name='subproject' type='subprojectType'/> <xs:element name='member' type='memberType'/> </xs:choice> </xs:complexType> + <xs:complexType name='descriptionType'> + <xs:simpleContent> + <xs:extension base='xs:token'> + <xs:attribute name='fake-only-once' + fixed='there can be at most one <description/> element'/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name='subprojectType'> <xs:attribute name='inherit-members' type='numericBoolType'/> <xs:attribute name='ref' type='projectRefType'/> |