Calculate the difference between two nodes
Is it possible to find the difference two nodes and use the that difference as a constraint for a particular control.
<xforms:bind id="DebitRebate1"
nodeset="instance('charge-options-setup')/Pattern_Setup1/Pattern1/DebitRebate1"
type="xforms:d开发者_C百科ouble"
constraint=". < instance('charge-options-setup')/Pattern_Setup1/Pattern1/DebitPrice1
and instance('charge-options-setup')/Pattern_Setup1/Pattern1/DebitPrice1-. >
instance('charge-options-setup')/Locations_Patterns/Debit_Minimum_Margin"/>
Yes, you can use the difference between two nodes as a constraint on another node, and the code you quote seems about right. Just a couple of comments:
- In your XPath, instead of
<
and>
you can use justlt
andgt
. This performs a value comparison, and makes the expression easier to read. - Also make sure you have spaces around node named: instead of
DebitPrice1-.
useDebitPrice1 - .
. This is necessary, as-
can be used as part of an element or attribute name, sofoo-bar
point to<foo-bar>
not what's in<foo>
minus what's in<bar>
.
精彩评论