开发者

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=". &lt; instance('charge-options-setup')/Pattern_Setup1/Pattern1/DebitPrice1
                and instance('charge-options-setup')/Pattern_Setup1/Pattern1/DebitPrice1-. &gt;
                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 &lt; and &gt; you can use just lt and gt. This performs a value comparison, and makes the expression easier to read.
  • Also make sure you have spaces around node named: instead of DebitPrice1-. use DebitPrice1 - .. This is necessary, as - can be used as part of an element or attribute name, so foo-bar point to <foo-bar> not what's in <foo> minus what's in <bar>.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜