xforms:repeat / current element

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

xforms:repeat / current element

Ronthe
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
Reply | Threaded
Open this post in threaded view
|

RE: xforms:repeat / current element

Ryan Puddephatt
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
Reply | Threaded
Open this post in threaded view
|

RE: xforms:repeat / current element

Ronthe
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
Reply | Threaded
Open this post in threaded view
|

RE: xforms:repeat / current element

David McIntyre
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
 
 
Dave McIntyre
Software Developer
2nd Floor, Orion House, cnr Enfield & Mary St, Mt Eden, PO Box 8273, Auckland, New Zealand
M.+64 21 212 8087 P.+64 9 638 0600 F.+64 9 638 0699
S.<A href="callto:dave.mcintyre">dave.mcintyre E.[hidden email] W.www.orionhealth.com
This e-mail and any attachments are intended only for the person to whom it is addressed and may contain privileged, proprietary, or other data protected from disclosure under applicable law. If you are not the addressee or the person responsible for delivering this to the addressee you are hereby notified that reading, copying or distributing this transmission is prohibited. If you have received this e-mail in error, please telephone us immediately and remove all copies of it from your system. Thank you for your co-operation.
e
>>> Ronny Theunissen 23/11/2006 6:09 a.m. >>>

Thank you for your lightning-fast response !

gts,
Ronny


-----Original Message-----
From: Ryan Puddephatt [[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]
> > [[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
Reply | Threaded
Open this post in threaded view
|

Re: xforms:repeat / current element

Henrik Pettersen
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:
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
 
 
Dave McIntyre
Software Developer
2nd Floor, Orion House, cnr Enfield & Mary St, Mt Eden, PO Box 8273, Auckland, New Zealand
M.+64 21 212 8087 P.+64 9 638 0600 F.+64 9 638 0699
S.dave.mcintyre E.[hidden email] W.<a href="http://www.orionhealth.com/" target="_blank" onclick="bluecoat_allow_popup=true;try{ return top.js.OpenExtLink(window,event,this) }finally{bluecoat_allow_popup=false;}">www.orionhealth.com




This e-mail and any attachments are intended only for the person to whom it is addressed and may contain privileged, proprietary, or other data protected from disclosure under applicable law. If you are not the addressee or the person responsible for delivering this to the addressee you are hereby notified that reading, copying or distributing this transmission is prohibited. If you have received this e-mail in error, please telephone us immediately and remove all copies of it from your system. Thank you for your co-operation.
e
>>> Ronny Theunissen 23/11/2006 6:09 a.m. >>>

Thank you for your lightning-fast response !

gts,
Ronny


-----Original Message-----
From: Ryan Puddephatt [[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]
> > [[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: <a onclick="bluecoat_allow_popup=true;try{ return top.js.OpenExtLink(window,event,this) }finally{bluecoat_allow_popup=false;}" href="http://www.objectweb.org/wws" target="_blank">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