Hi,
Inside a repeat-statement the current element in xpath can be retrieved using current(). However, this does not seem to work in combination with an xpath over another insyance. The output statement (inside the repeat) using the xpath is the following: <xforms:output value="instance('objectlocations-list-instance')//item[current()/location=@value]/@label" /> where instance('...') refers to an item-list (as used by trees). In short this statement should translate a value of the current element using another (translation-)instance. How can I achieve this? gts, Ronny -- 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 |
Ronny,
current() is also an xpath function, so in your example it will return the current context rather than the repeat context you are after. You can use the extention function xxforms:repeat-current() to achieve what you need Ryan Ryan Puddephatt Software Engineer Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP e> [hidden email] t> +44(0)1506 407 110 f> +44(0)1506 407 108 >-----Original Message----- >From: [hidden email] >[mailto:[hidden email]] >Sent: 22 November 2006 16:34 >To: [hidden email] >Subject: [ops-users] xforms:repeat / current element > >Hi, > >Inside a repeat-statement the current element in xpath can be >retrieved using current(). However, this does not seem to work >in combination with an xpath over another insyance. The output >statement (inside the repeat) using the xpath is the following: ><xforms:output >value="instance('objectlocations-list-instance')//item[current( >)/location=@value]/@label" /> where instance('...') refers to >an item-list (as used by trees). >In short this statement should translate a value of the >current element using another (translation-)instance. > >How can I achieve this? > >gts, >Ronny > > -- 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 |
Thank you for your lightning-fast response !
gts, Ronny -----Original Message----- From: Ryan Puddephatt [mailto:[hidden email]] Sent: Wed 11/22/2006 5:41 PM To: [hidden email] Subject: RE: [ops-users] xforms:repeat / current element Ronny, current() is also an xpath function, so in your example it will return the current context rather than the repeat context you are after. You can use the extention function xxforms:repeat-current() to achieve what you need Ryan Ryan Puddephatt Software Engineer Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP e> [hidden email] t> +44(0)1506 407 110 f> +44(0)1506 407 108 >-----Original Message----- >From: [hidden email] >[mailto:[hidden email]] >Sent: 22 November 2006 16:34 >To: [hidden email] >Subject: [ops-users] xforms:repeat / current element > >Hi, > >Inside a repeat-statement the current element in xpath can be >retrieved using current(). However, this does not seem to work >in combination with an xpath over another insyance. The output >statement (inside the repeat) using the xpath is the following: ><xforms:output >value="instance('objectlocations-list-instance')//item[current( >)/location=@value]/@label" /> where instance('...') refers to >an item-list (as used by trees). >In short this statement should translate a value of the >current element using another (translation-)instance. > >How can I achieve this? > >gts, >Ronny > > -- 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 winmail.dat (4K) Download Attachment |
In reply to this post by Ronthe
As Ryan has said, the xxforms:repeat-current() function is surely what you want here. But another trick to add to your toolbox would be something along the lines of
value="for $current in current() return instance('objectlocations-list-instance')//item[$current/location=@value]/@label"
Cheers,
Dave McIntyr
e >>> Ronny Theunissen 23/11/2006 6:09 a.m. >>> Thank you for your lightning-fast response ! gts, -----Original Message----- Ryan Ryan Puddephatt Teleflex Group - IT UK e> > [hidden email]
> > -----Original Message----- -- 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 |
Dave,
that's very usefull! I can see I have to expand my knowledgedge of XPath.... Thanks! Henrik On 11/22/06, David McIntyre <
[hidden email]> wrote:
-- 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 |