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

74 months ago

Hi,
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

<filters>
<filter>
<type>type one</type>
<location>/theirlist/obvious</location>
</filter>
<type>type two</type>
<location>/mylist/special</location>
</filter>
</filters>
<mylist>
<obvious>.. some nodes between ..</obvious>
</mylist>
<theirlist>
<special>.. some nodes between ..</special>
</theirlist>
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-->
</xsl:foreach>

</xsl:foreach>

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

- Was this comment helpful? Yes / No Reply - Report abuse

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