Logical test in Schematron
Posted: Fri Jan 07, 2022 7:02 pm
Hi
I have a task to design a validation using schematron, but I can’t figure if it’s possible.
The validation is a two parts validation as following:
I have the values in the following two variables
Question
How to “code” the logic below in “schematron” – if possible
If ("PayableSum" = -0) then
----Variable "AlteredPayableSum" = 0
Else
----Variable "AlteredPayableSum" = PayableSum
Final validation
Hope somebody can help
Rgds,
Dan
I have a task to design a validation using schematron, but I can’t figure if it’s possible.
The validation is a two parts validation as following:
- First, I need to ensure that variable 1 is converted to 0 if the original value is -0
- Second, I need check if the value in the two variables are the same
I have the values in the following two variables
- Variable 1: <sch:let name="PayableSum" value="format-number (sum(PayableAmount) ,'##.00')"/>
- Variable 2: <sch:let name="TotalSum" value="format-number (sum(TotalAmout) ,'##.00')"/>
Question
How to “code” the logic below in “schematron” – if possible
If ("PayableSum" = -0) then
----Variable "AlteredPayableSum" = 0
Else
----Variable "AlteredPayableSum" = PayableSum
Final validation
- <sch:assert test="$AlteredPayableSum = $TotalSum">The two amounts are not equal</sch:assert>
Hope somebody can help
Rgds,
Dan