Schematron problem
Posted: Mon Apr 11, 2011 12:53 pm
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:
Code: Select all
<DNgV>
<DeviceTest name="test1" type="Test" spec="harddisc">
<parent name="ptest1" type="Test" spec="pci">
<parent name="pptest1" type="Test" spec="pci">
...
In schematron i wrote following:
Code: Select all
<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>
Greetz
m0ps