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

RE: xsl:apply-templates with variable

Subject: RE: xsl:apply-templates with variable
From: cknell@xxxxxxxxxx
Date: Tue, 21 Sep 2004 16:35:40 -0400
xsl apply templates variable
The last exception points you in the right direction.

"javax.xml.transform.TransformerException: A node test that matches
either NCName:* or QName was expected."

The spec specifically prohibits the kind of dynamic evaluation in template matching and in XPath expressions. Michael Kay has answered this kind of question many times on this list.

You might try a construct like this:

<xsl:choose>
  <xsl:when test="$ROOT='CUSTOMER'">
    <xsl:apply-templates select="CUSTOMER"/>
  </xsl:when>
  <xsl:when test="$ROOT='DEPARTMENT'">
    <xsl:apply-templates select="DEPARTMENT"/>
  </xsl:when>
  <xsl:otherwise>
<!-- Default template match goes here -->
  </xsl:otherwise>
</xsl:choose>
-- 
Charles Knell
cknell@xxxxxxxxxx - email

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.