Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XSL with XML parameters XSL with XML parametersTo: NULL Date: 2/18/2009 1:57:00 AM Hi there!
I've been trying a lot of approaches to make a select based on some
values I have in the XML document. I'll explain myself:
I have an XML document like this:
<doc>
<item>
<type1>
<type2>
<item>
<type1>
<type2>
.......... (N items)
<param>
<key>
<value>
</doc>
Ok, in param (which will be a unique record), i'll pass in key the
name of the attribute (which will be an attribute of item) and the
value is the value to be searched.
So i.e. <param><key>type1</key><value>ToSearch</value></param>
I bind variables values as:
<xsl:variable name="key" select="param/key" />
<xsl:variable name="value" select="param/value" />
the expression i would like to generate is a <xsl:for-each select="item
[$key=$value]">
This won't work, If I write it as "item[type1=$value]" it works, but
the point is to make it dinamyc (that's why $key is a variable).
Thanks
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
