diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-04-16 19:27:08 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-04-16 19:27:08 +0200 |
commit | 9de0e83fb8bc56c8e2db187e6bc66dc85cce9afa (patch) | |
tree | ba759bffc8834856e60a63e1f3476c372771512f | |
parent | projects: Ensure at most one <description/> for each project (diff) | |
download | xml-schema-9de0e83fb8bc56c8e2db187e6bc66dc85cce9afa.tar.gz xml-schema-9de0e83fb8bc56c8e2db187e6bc66dc85cce9afa.tar.bz2 xml-schema-9de0e83fb8bc56c8e2db187e6bc66dc85cce9afa.zip |
metadata: Use more portable fake-attr uniquity constraint for subslots
-rw-r--r-- | metadata.xsd | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/metadata.xsd b/metadata.xsd index 493c930..0ead09e 100644 --- a/metadata.xsd +++ b/metadata.xsd @@ -51,6 +51,10 @@ <xs:selector xpath='slot'/> <xs:field xpath='@name'/> </xs:unique> + <xs:unique name='subslotsSingleConstraint'> + <xs:selector xpath='subslots'/> + <xs:field xpath='@fake-only-once'/> + </xs:unique> </xs:element> <xs:element name='upstream' type='upstreamType'> <xs:unique name='bugsToSingleConstraint'> @@ -175,25 +179,9 @@ <!-- slots --> <xs:complexType name='slotsType'> - <!-- the crazy magic below is to cover any order possible - in a deterministic way --> - <xs:choice> - <xs:sequence> - <xs:element name='slot' type='slotType' - minOccurs='1' maxOccurs='unbounded'/> - <xs:sequence minOccurs='0' maxOccurs='1'> - <xs:element name='subslots' type='xs:token' - minOccurs='1' maxOccurs='1'/> - <xs:element name='slot' type='slotType' - minOccurs='0' maxOccurs='unbounded'/> - </xs:sequence> - </xs:sequence> - <xs:sequence> - <xs:element name='subslots' type='xs:token' - minOccurs='1' maxOccurs='1'/> - <xs:element name='slot' type='slotType' - minOccurs='0' maxOccurs='unbounded'/> - </xs:sequence> + <xs:choice minOccurs='0' maxOccurs='unbounded'> + <xs:element name='slot' type='slotType'/> + <xs:element name='subslots' type='tokenOnceType'/> </xs:choice> <xs:attribute name='lang' type='langAttrType' default='en'/> </xs:complexType> @@ -532,6 +520,15 @@ </xs:restriction> </xs:simpleType> + <xs:complexType name='tokenOnceType'> + <xs:simpleContent> + <xs:extension base="xs:token"> + <xs:attribute name='fake-only-once' + fixed='there can be at most one element of this type'/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:simpleType name='urlType'> <xs:restriction base='xs:token'> <!-- TODO: something better? --> |