Schematron validation problem

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Schematron validation problem

    heyho,
    have a XML like:

    Quellcode

    1. <DNgV>
    2. <DeviceTest name="test1" type="Test" spec="harddisc">
    3. <parent name="ptest1" type="Test" spec="pci">
    4. <parent name="pptest1" type="Test" spec="pci">
    5. ...



    I use Schematron Validation and want to test, if DeviceTest-name attribute is unique. Means no other DeviceTest-name and no other parent-name should have the same string.

    In schematron i wrote following:

    Quellcode

    1. <iso:pattern id="uniqueness.DInvDeviceTest">
    2. <iso:rule context="//dnv:DeviceTest/@name">
    3. <iso:assert test="count(//dnv:DeviceTest/@name[. = current()]) = 1">
    4. Attribute is not unique in 'DeviceTest'
    5. </iso:assert>
    6. <iso:assert test="count(//dnv:parent/@name[. = current()]) = 1">
    7. Attribute is not unique 'parent/DeviceTest'
    8. </iso:assert>
    9. </iso:rule>
    10. </iso:pattern>


    This Schematron works for the test if another DeviceTest has the same name. But i can't figure out why the second test allways leads to an error. what's wrong here?

    Greetz
    m0ps