xformsxsltforms

Filtering an instance with multiple binds doesn't seem to work


The idea is to take a model instance and partition it according to a score.

      <bind nodeset="instance('mDetails')/review" readonly="true()" id="liked" relevant="algorithmScore > 0"/>
  <bind nodeset="instance('mDetails')/review" readonly="true()" id="neutral" relevant="algorithmScore = 0"/>
  <bind nodeset="instance('mDetails')/review" readonly="true()" id="disliked" relevant="algorithmScore &lt; 0"/>

Where above we have an instance containing all the reviews and I want to create different bindings based on the algorithm score (positive, neutral or negative).

Then in my UI

            <repeat bind="liked">
          <input ref="@critic">
            <label>Critic</label>
          </input>  

is supposed to retrieve the subset that liked it (algorithmScore is positive) etc

However when I run this code I get the dislikes showing up when I request the likes and the model prunes away the non-relevant rows (which I believe is supposed to happen).

Am I right that XForms is not designed to do this sort of thing in this way?


Solution

  • Only the last bind element is considered because all bindings are defined for the very same node set.