heyho,
have a XML like:
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:
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
have a XML like:
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
- <iso:pattern id="uniqueness.DInvDeviceTest">
- <iso:rule context="//dnv:DeviceTest/@name">
- <iso:assert test="count(//dnv:DeviceTest/@name[. = current()]) = 1">
- Attribute is not unique in 'DeviceTest'
- </iso:assert>
- <iso:assert test="count(//dnv:parent/@name[. = current()]) = 1">
- Attribute is not unique 'parent/DeviceTest'
- </iso:assert>
- </iso:rule>
- </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