discrepancy in xpath for ref and nodeset

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

discrepancy in xpath for ref and nodeset

vernekap
Is there a discrepancy on how we specify xpath for attribute ref and attribute nodeset?

I had to specify ref as, ref="instance('product-state')/properties/property[name='x.y.z']"

where as for nodeset this did not and after going through examples I got that working through:

                <xforms:itemset nodeset="instance('options-instance')//property[<b>@name = 'x.y.z']/item">
                    <xforms:label ref="@label"/>
                    <xforms:value ref="@value"/>
                </xforms:itemset>

Is there any reason behind this?

Pralhad
Reply | Threaded
Open this post in threaded view
|

Re: discrepancy in xpath for ref and nodeset

Hank Ratzesberger
Pralhad,

One difference is that ref is a "Siongle Node Binding" attribute
so it always binds to just one element:

http://www.w3.org/TR/xforms11/#structure-attrs-single-node

Whereas, nodeset binds to multiple elements:

http://www.w3.org/TR/xforms11/#structure-attrs-nodeset

--Hank


On May 13, 2009, at 3:41 AM, vernekap wrote:

>
> Is there a discrepancy on how we specify xpath for attribute ref and
> attribute nodeset?
>
> I had to specify ref as,
> ref="instance('product-state')/properties/property[name='x.y.z']"
>
> where as for nodeset this did not and after going through examples  
> I got
> that working through:
>
>                 <xforms:itemset
> nodeset="instance('options-instance')//property[@name = 'x.y.z']/
> item">
>                     <xforms:label ref="@label"/>
>                     <xforms:value ref="@value"/>
>                 </xforms:itemset>
>
> Is there any reason behind this?
>
> Pralhad
>
> --
> View this message in context: http://www.nabble.com/discrepancy-in- 
> xpath-for-ref-and-nodeset-tp23519417p23519417.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: discrepancy in xpath for ref and nodeset

Alessandro Vernet
Administrator
In reply to this post by vernekap
Pralhad,

vernekap wrote
instance('product-state')/properties/property[name='x.y.z']"
instance('options-instance')//property[@name = ...
Your first expression above tests on the existence of an element (name = ...) while the second one tests on the existence of an attribute (@name = ...). I guess that in one case you must have an element "name", and the other an attribute "name".

Alex