[xsl] Parameter in Predicate in xsl:template match problem

Subject: [xsl] Parameter in Predicate in xsl:template match problem
From: Nathaniel Brett Stoddard <nstoddar@xxxxxxxxx>
Date: Wed, 16 Apr 2003 15:41:52 -0700 (PDT)
Hi folks -- this is my first xslt document, so I'm not quite sure if this is a newbie issue or
not, but here goes (and thanks in advance).

All I want to do is use a <xsl:param> that I defined earlier and set with MSXML before I did the
transformation, in a predicate of a <xsl:template match="....">.  I won't bother giving you all
the xml and xslt text because I don't think it really matters.  But here is an exerpt:

*.xml:

<category b="3">
  <category b="4">
    <a>Something</a>
  </category>
</category>

*.xsl:

<xsl:param name="target_category" select="'3'"/>
<xsl:template match="//category[@b='3']">

The preceding line works, but what I really want is:

<xsl:template match="//category[@b={$target_category}]">

or something very close to it.  Depending on the permutation of { and ' I use
with my variable name, MSXML either tells me I can't use a variable there, it
does nothing (does not match correctly), or registers as a syntax error.

Thanks for the help folks -- my high-paying job at IBM depends on your answer .. um .. well
scratch that :( , but definitely thanks.

Nathaniel Stoddard


__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread