Question about dependency model and referents node in XPath Expression

Hello,

I've got a question about  dependency model and referents node in XPath
Expression ...
Considering  this XForms ...

<html>
<head>
<xf:model>
<xf:instance>
<root xmlns="">
    <class enable="true">
        <rate>10</rate>
    </class>
    <class enable="false">
        <rate>15</rate>
    </class>
    <class enable="true">
        <rate>20</rate>
    </class>
</root>
</xf:instance>
<xf:bind nodeset="//class/@enable" type="xsd:boolean" />
</xf:model>
</head>
<body>

<xf:output value="sum(//class[@enable='true']/rate)" />

<xf:repeat nodeset="class">
    <fieldset>
    <legend>class</legend>
    <xf:input ref="@enable">
       <xf:label>Enable</xf:label>
    </xf:input>
    <xf:input ref="rate">
       <xf:label>Rate</xf:label>
    </xf:input>
    </fieldset>
</xf:repeat>

</body>
</html>

As you can see using the repeat module I can display three class rate
value with a checkbox (type xsd:boolean) button to enable/disable each.
Considering this XPath output element :

<xf:output value="sum(//class[@enable='true']/rate)" />

When My XForms processor evaluate  the expression and find "referents"
nodes bellow, only "rate" node with predicate @enable='true' are added
to dependency model during initial
"rebuild+recalculate+revalidate+refresh" sequence

Now, if I change @enable attribute value of the 2nd class node to 'true'
(intialiy @enable='false') and If i change the "rate" value the  "sum" 
output will not be recomputed.
I must check / uncheck  the enable button to refresh it ...

My question is : does my XPath engine should ignore [@enable='true]
predicate and append all  "rate" childs  nodes as referents  ?
When I force this behavior in my XPath lib the "sum"  is recomputed
correctly when I change any rate value.


Thanks for you help

Regards

Received on Saturday, 6 January 2007 16:00:19 UTC