diff options
author | 2016-03-02 16:11:37 +0100 | |
---|---|---|
committer | 2016-03-02 16:11:37 +0100 | |
commit | ebddc2000b4c22ef9ffe91da5185a85ca97abd50 (patch) | |
tree | db11a22e60e095c9c567030ccc7dd730c15e5322 | |
parent | metadata.xml: Do not allow restrict="" in per-category metadata (diff) | |
download | xml-schema-ebddc2000b4c22ef9ffe91da5185a85ca97abd50.tar.gz xml-schema-ebddc2000b4c22ef9ffe91da5185a85ca97abd50.tar.bz2 xml-schema-ebddc2000b4c22ef9ffe91da5185a85ca97abd50.zip |
metadata.xml: Add uniquity constraints
-rw-r--r-- | metadata.xsd | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/metadata.xsd b/metadata.xsd index 2e2d614..24e3631 100644 --- a/metadata.xsd +++ b/metadata.xsd @@ -2,18 +2,52 @@ <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'> <!-- top-level variants --> - <xs:element name='pkgmetadata' type='pkgMetadataType'/> - <xs:element name='catmetadata' type='catMetadataType'/> + <xs:element name='pkgmetadata' type='pkgMetadataType'> + <xs:unique name='longDescUniquityConstraint'> + <xs:selector xpath='longdescription'/> + <xs:field xpath='@lang'/> + <xs:field xpath='@restrict'/> + </xs:unique> + <xs:unique name='slotsUniquityConstraint'> + <xs:selector xpath='slots'/> + <xs:field xpath='@lang'/> + </xs:unique> + <xs:unique name='useUniquityConstraint'> + <xs:selector xpath='use'/> + <xs:field xpath='@lang'/> + </xs:unique> + </xs:element> + <xs:element name='catmetadata' type='catMetadataType'> + <xs:unique name='catLongDescUniquityConstraint'> + <xs:selector xpath='longdescription'/> + <xs:field xpath='@lang'/> + </xs:unique> + </xs:element> <!-- global elements --> <xs:complexType name='pkgMetadataType'> <xs:choice minOccurs='0' maxOccurs='unbounded'> <xs:element name='longdescription' type='longDescType'/> - <xs:element name='maintainer' type='maintainerType'/> + <xs:element name='maintainer' type='maintainerType'> + <xs:unique name='maintainerDescUniquityConstraint'> + <xs:selector xpath='description'/> + <xs:field xpath='@lang'/> + </xs:unique> + </xs:element> <xs:element name='natural-name' type='xs:token'/> <xs:element name='slots' type='slotsType'/> - <xs:element name='upstream' type='upstreamType'/> - <xs:element name='use' type='useType'/> + <xs:element name='upstream' type='upstreamType'> + <xs:unique name='upstreamDocUniquityConstraint'> + <xs:selector xpath='doc'/> + <xs:field xpath='@lang'/> + </xs:unique> + </xs:element> + <xs:element name='use' type='useType'> + <xs:unique name='flagUniquityConstraint'> + <xs:selector xpath='flag'/> + <xs:field xpath='@restrict'/> + </xs:unique> + </xs:element> </xs:choice> </xs:complexType> @@ -26,7 +60,12 @@ <!-- the huge <upstream/> structure --> <xs:complexType name='upstreamType'> <xs:choice minOccurs='0' maxOccurs='unbounded'> - <xs:element name='maintainer' type='upstreamMaintainerType'/> + <xs:element name='maintainer' type='upstreamMaintainerType'> + <xs:unique name='upstreamMaintainerDescUniquityConstraint'> + <xs:selector xpath='description'/> + <xs:field xpath='@lang'/> + </xs:unique> + </xs:element> <xs:element name='changelog' type='urlType'/> <xs:element name='doc' type='upstreamDocType'/> <xs:element name='bugs-to' type='urlType'/> |