String to nodeset (revised)

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

String to nodeset (revised)

lkbrown
 have a string stored in a variable or xml elements that I would like to use in an xpath expression.
Is there an easy way to convert this string to a node set ?

example::

model:

<xf:instance id="data-config" xmlns="">
<data>                                       
    <path>="/ai:inventory/ai:products/ai:product</path>
</data>
</xf:instance>

....

body:

<xf:repeat nodeset="{instance('data-config')/path}" id="product-repeat">

This doesn't work.

.....
Reply | Threaded
Open this post in threaded view
|

Re: String to nodeset (revised)

Louis Ratzesberger

You may be able to create a variable like this
(untested example)

<xforms:variable name="nodes"
  select="for $s in tokenize(instance('data-config'),'\s')
  return xxforms:element('text',$s)"/>

Let us know if that works!

-- Louis (Hank) Ratzesberger


Quoting lkbrown <[hidden email]>:

>
>  have a string stored in a variable or xml elements that I would like to use
> in an xpath expression.
> Is there an easy way to convert this string to a node set ?
>
> example::
>
> model:
>
> <xf:instance id="data-config" xmlns="">
> <data>
>     <path>="/ai:inventory/ai:products/ai:product</path>
> </data>
> </xf:instance>
>
> ....
>
> body:
>
> <xf:repeat nodeset="{instance('data-config')/path}" id="product-repeat">
>
> This doesn't work.
>
> .....
>
> --
> View this message in context:  
> http://n4.nabble.com/String-to-nodeset-revised-tp2016150p2016150.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>


--
Hank Ratzesberger
[hidden email]



--
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: String to nodeset (revised)

lkbrown
hank,

Thanks for your reply..but I found an easier solution.

the xxforms:evaluate() function.

<xf:repeat nodeset="xxforms:evaluate(instance('data-config')/path)"