NRL to Schematron

Constraint Language

Expressions

NRL XPath Comment
6 6
6.2 6.2
'test' 'test'
true true()
false false()
numberOfLegs numberOfLegs
5+4 5 + 4
5.2+4.3 5.2 + 4.3
5.2+4 5.2 + 4
5-4 5 - 4
5*4 5 * 4
5 / 4.2 5 div 4.2
6 mod 4 6 mod 4
2>3 2 > 3
2<3 2 < 3
2.3<=3.5 2.3 <= 3.5
2.3>=3.5 2.3 >= 3.5
2=3 2 = 3
2<>3 2 != 3
true and false true() and false()
true or false true() or false()
true implies false not(true()) or false()
true = false true() = false()
true <> false true() != false()
if 1=1 then 2=2 not(1 = 1) or 2 = 2
totalValue.amount totalValue/amount

Rules

NRL Rule Schematron Comment
Context: Trade
Validation Rule "r1"
id = 'trade1'
<rule context="//trade" id="r1">
<assert test="id = 'trade1'"/>
</rule>
Context: Amount
Validation Rule "r2"
amount >= 10000
<rule context="//trade/leg/pay | //trade/leg/receive | //trade/leg/netCashFlow | //trade/totalValue" id="r2">
<assert test="amount >= 10000"/>
</rule>
Context: Amount
Validation Rule "r3"
amount is not equal to 10000
<rule context="//trade/leg/pay | //trade/leg/receive | //trade/leg/netCashFlow | //trade/totalValue" id="r3">
<assert test="amount != 10000"/>
</rule>
Context: Trade
Validation Rule "r4"
numberOfLegs = 6
<rule context="//trade" id="r4">
<assert test="numberOfLegs = 6"/>
</rule>