[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Parameter in Predicate in xsl:template match problem

Subject: Parameter in Predicate in xsl:template match problem
From: Nathaniel Brett Stoddard <nstoddar@xxxxxxxxx>
Date: Wed, 16 Apr 2003 15:41:52 -0700 (PDT)
xsl template match parameter
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.