Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSL with XML parameters

From: "Guillermo C." <guicifuentes@-----.--->
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent