Xpath evaluate

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

Xpath evaluate

Binesh Gummadi
Good Morning.

I wrote a custom xbl component which works as expected.

<fr:image-picker ref="instance('instance')/images" width="300" height="400" />

Look at how width and height takes static values. I want to be able to provide xpath and pass the evaluated expression. How do I do that?

It should look something like this

<fr:image-picker ref="instance('instance')/images" width="xxforms:evaluate(instance('instance')/height)" height="xxforms:evaluate(instance('instance')/width)" />

Ideally I want to evaluate it before sending it to xbl.

Thanks
Binesh
Reply | Threaded
Open this post in threaded view
|

Re: Xpath evaluate

Erik Bruchez
Administrator
Binesh,

One way to do this is, within your XBL, to use variables to track the external value, e.g.:

<xxf:variable name="width" xxbl:scope="inner">
  <xxf:sequence xbl:attr="select=width" xxbl:scope="outer">
</xxf:variable>

This would, within the XBL component, make a $width variable available with the value of your @width attribute.

-Erik

On Tue, Jun 22, 2010 at 8:38 AM, Binesh Gummadi <[hidden email]> wrote:

Good Morning.

I wrote a custom xbl component which works as expected.

<fr:image-picker ref="instance('instance')/images" width="300" height="400"
/>

Look at how width and height takes static values. I want to be able to
provide xpath and pass the evaluated expression. How do I do that?

It should look something like this

<fr:image-picker ref="instance('instance')/images"
width="xxforms:evaluate(instance('instance')/height)"
height="xxforms:evaluate(instance('instance')/width)" />

Ideally I want to evaluate it before sending it to xbl.

Thanks
Binesh

--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Xpath-evaluate-tp2264307p2264307.html
Sent from the Orbeon Forms (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




--
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: Xpath evaluate

Binesh Gummadi
Thanks Erik.

Since I am using <xsl:copy-of select="xxbl:parameter(., 'width')" /> and reading the width value in Javascript, I tried the following and it worked. Please comment if it doesn't look right.

For values I am using
<fr:image-picker ref="instance('instance')/images" width="300" height="400" />

For XPath I am using
<fr:image-picker ref="instance('instance')/images" >
   <fr:height ref="xpath" />
   <fr:width ref="xpath" />
</fr:image-picker>

Binesh
Reply | Threaded
Open this post in threaded view
|

Re: Re: Xpath evaluate

Alessandro  Vernet
Administrator
Binesh,

Yes, xxbl:parameter() is the way to go, as described on:

http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Read-only-parameters

Alex

On Thu, Jun 24, 2010 at 1:25 PM, Binesh Gummadi <[hidden email]> wrote:

>
> Thanks Erik.
>
> Since I am using <xsl:copy-of select="xxbl:parameter(., 'width')" /> and
> reading the width value in Javascript, I tried the following and it worked.
> Please comment if it doesn't look right.
>
> For values I am using
> <fr:image-picker ref="instance('instance')/images" width="300" height="400"
> />
>
> For XPath I am using
> <fr:image-picker ref="instance('instance')/images" >
>   <fr:height ref="xpath" />
>   <fr:width ref="xpath" />
> </fr:image-picker>
>
> Binesh
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Xpath-evaluate-tp2264307p2267618.html
> Sent from the Orbeon Forms (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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet