Hi,
I have the following set value that is not behaving as I expect: <xforms:setvalue ref="instance('locks-instance')/division/lock[position() eq xs:integer(instance('control-instance')/unitPosition)]/locked" value="instance('control-instance')/controls/lockAllControl"/> The locks looks something like bellow. So in the above path I expect the path instance('locks-instance')/division/lock[position() eq 4] to return the unit with id=4 (its the 4rth loch selected byt the path). Instead the lock with id=8 is returned (its the only one 4rth in ints parent). Is this a bug or am I just wrong in my assumption that position should return the position in the selected sequence? Thanks, Dave <root> <division> <name>Corporate</name> <lock> <unitID>1</unitID> <locked>true</locked> </lock> <lock> <unitID>2</unitID> <locked>true</locked> </lock> <lock> <unidID>3</unitID> <locked>true</locked> </lock> </division> <division> <name>Medicalname> <lock> <unitID>4</unitID> <locked>true</locked> </lock> <lock> <unitID>5</unitID> <locked>true</locked> </lock> <lock> <unidID>7</unitID> <locked>true</locked> </lock> <lock> <unidID>8</unitID> <locked>true</locked> </lock> </division> </root> -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Dave,
Operator precedence is at work here: "[" has higher precedence than "/", so your expression is in fact equivalent to: instance('locks-instance')/division/(lock[position() eq 4])/locked Try instead: (instance('locks-instance')/division/lock)[position() eq 4]/locked -Erik > I have the following set value that is not behaving as I expect: > > <xforms:setvalue > ref="instance('locks-instance')/division/lock[position() eq > xs:integer(instance('control-instance')/unitPosition)]/locked" > > value="instance('control-instance')/controls/lockAllControl"/> > > The locks looks something like bellow. So in the above path I expect > the path instance('locks-instance')/division/lock[position() eq 4] to > return the unit with id=4 (its the 4rth loch selected byt the path). > Instead the lock with id=8 is returned (its the only one 4rth in ints > parent). Is this a bug or am I just wrong in my assumption that > position should return the position in the selected sequence? > > Thanks, > > Dave > > <root> > <division> > <name>Corporate</name> > <lock> > <unitID>1</unitID> > <locked>true</locked> > </lock> > <lock> > <unitID>2</unitID> > <locked>true</locked> > </lock> > <lock> > <unidID>3</unitID> > <locked>true</locked> > </lock> > </division> > <division> > <name>Medicalname> > <lock> > <unitID>4</unitID> > <locked>true</locked> > </lock> > <lock> > <unitID>5</unitID> > <locked>true</locked> > </lock> > <lock> > <unidID>7</unitID> > <locked>true</locked> > </lock> > <lock> > <unidID>8</unitID> > <locked>true</locked> > </lock> > > > </division> </root> -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Thanks for the explanation Erik that did the trick!
Erik Bruchez wrote: > Dave, > > Operator precedence is at work here: "[" has higher precedence than > "/", so your expression is in fact equivalent to: > > instance('locks-instance')/division/(lock[position() eq 4])/locked > > Try instead: > > (instance('locks-instance')/division/lock)[position() eq 4]/locked > > -Erik > > > I have the following set value that is not behaving as I expect: > > > > <xforms:setvalue > > ref="instance('locks-instance')/division/lock[position() eq > > xs:integer(instance('control-instance')/unitPosition)]/locked" > > > > value="instance('control-instance')/controls/lockAllControl"/> > > > > The locks looks something like bellow. So in the above path I expect > > the path instance('locks-instance')/division/lock[position() eq 4] to > > return the unit with id=4 (its the 4rth loch selected byt the path). > > Instead the lock with id=8 is returned (its the only one 4rth in ints > > parent). Is this a bug or am I just wrong in my assumption that > > position should return the position in the selected sequence? > > > > Thanks, > > > > Dave > > > > <root> > > <division> > > <name>Corporate</name> > > <lock> > > <unitID>1</unitID> > > <locked>true</locked> > > </lock> > > <lock> > > <unitID>2</unitID> > > <locked>true</locked> > > </lock> > > <lock> > > <unidID>3</unitID> > > <locked>true</locked> > > </lock> > > </division> > > <division> > > <name>Medicalname> > > <lock> > > <unitID>4</unitID> > > <locked>true</locked> > > </lock> > > <lock> > > <unitID>5</unitID> > > <locked>true</locked> > > </lock> > > <lock> > > <unidID>7</unitID> > > <locked>true</locked> > > </lock> > > <lock> > > <unidID>8</unitID> > > <locked>true</locked> > > </lock> > > > > > > </division> </root> > > ------------------------------------------------------------------------ > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |