|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl:apply-templates with 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








