XSL - use node value as future select expression for for-each

Get new comments by email
You can cancel email alerts at anytime.
Comments (1)

Jouda in Ceske Budejovice, Czech Republic

97 months ago

I would like to ask for help if anyone know how to achieve creating select expression string from a node-string.

i have nodes, filters node is always at the same place, but i before writing xml do not know
where will be the custom nodes, that is why i am writing its path into that nodes

<type>type one</type>
<type>type two</type>
<obvious>.. some nodes between ..</obvious>
<special>.. some nodes between ..</special>
when I use

<xsl:foreach select="/filters/filter">

<xsl:variable name="path" select="current()">

<!-- now i want to star foreach with value of node as select string -->

<xsl:foreach select="$path">
<!--some code between-->


variable $path cannot be used as xpath, it only selects what was already chosen as the variable. Can anyone help me please?


» Sign in or create an account to comment on this topic.