Ignore:
Timestamp:
01/15/16 16:09:21 (9 years ago)
Author:
Menzo Windhouwer
Message:

M toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd

  • use an xsl:key to check the uniqueness of an item in an enumeration

NOTE: needs the latest version of SchemAnon? that includes a fix in the Schematron XSLT to copy of over the XSLT elements in a xs:appinfo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd

    r6908 r6910  
    55-->
    66
    7 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://purl.oclc.org/dsdl/schematron"
     7<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    88    xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.0" vc:maxVersion="1.1">
    9 
     9   
    1010    <xs:import namespace="http://www.w3.org/XML/1998/namespace"
    1111        schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
     12
     13    <xs:annotation>
     14        <xs:appinfo>
     15            <xsl:key name="enums" match="item" use="."/>
     16        </xs:appinfo>
     17    </xs:annotation>
    1218
    1319    <!-- root element -->
     
    440446                    <sch:title>CMD enumeration item</sch:title>
    441447                    <sch:rule context="item">
    442                         <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>
     448                        <sch:assert test="count(key('enums',current(),current()/parent::enumeration)) eq 1">All items in an enumeration should be different. Found multiple items with value '<sch:value-of select="."/>'!</sch:assert>
    443449                    </sch:rule>
    444450                </sch:pattern>
Note: See TracChangeset for help on using the changeset viewer.