dependent values problem in schematron
Posted: Mon Dec 04, 2006 7:00 pm
Hello,
I am trying to use schematron to validate XML files but I am stuck on a situation that I cannot establish a rule for:
Sample XML:
<parameters>
<parameter>
<name>percentage</name>
<value>89</value>
</parameter>
<parameter>
<name>temperatureF</name>
<value>-274<value>
</parameter>
<parameters>
Rules I want to enforce via schematron:
1. If name = percentage then 0 <= value <= 100
2. If name = temperatureF then -40 <= value <= 40
etc.
The rules are controlled by a dictionarry are there are a lot of possibilities. I can't seem to get around the problem that the condition I want to test depends on the value of an element and the immediate sibling value. Any ideeas would be appreciated. Thank you very much.
I am trying to use schematron to validate XML files but I am stuck on a situation that I cannot establish a rule for:
Sample XML:
<parameters>
<parameter>
<name>percentage</name>
<value>89</value>
</parameter>
<parameter>
<name>temperatureF</name>
<value>-274<value>
</parameter>
<parameters>
Rules I want to enforce via schematron:
1. If name = percentage then 0 <= value <= 100
2. If name = temperatureF then -40 <= value <= 40
etc.
The rules are controlled by a dictionarry are there are a lot of possibilities. I can't seem to get around the problem that the condition I want to test depends on the value of an element and the immediate sibling value. Any ideeas would be appreciated. Thank you very much.