I have the following stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
version="1.0">
<xsl:template match="/">
<!-- <xsl:variable name="exper" select="'//Category[attribute::name='Cat2']'"/> -->
<xsl:variable name="exper" select="'//Category'"/>
<xsl:copy-of select="xalan:evaluate($exper)"/>
</xsl:template>
</xsl:stylesheet>
Where I am using xalan:evaluate extension function.
// Works Fine Starts --------------------------------------------------------------------------------------------------------------------------
// If I use the simple xpath it works fine.
<xsl:variable name="exper" select="'//Category'"/>
<xsl:copy-of select="xalan:evaluate($exper)"/>
// Works Fine Ends --------------------------------------------------------------------------------------------------------------------------
// Problem Starts --------------------------------------------------------------------------------------------------------------------------
// But if I use the conditional xpath it does not work See below
<xsl:variable name="exper" select="'//Category[attribute::name='Cat2']'"/>
<xsl:copy-of select="xalan:evaluate($exper)"/>
It gives me Exception Message: javax.xml.transform.TransformerException: Extra illegal tokens: 'Cat2', '']''
// Problem Ends --------------------------------------------------------------------------------------------------------------------------
Is there a restriction on the XPath being used as an argument to xalan:evaluate()?
or
Am I doing something wrong?
Thanks in advance.
Regards,
Atul Patel
17 Skyline Drive, J2-A29,
Hawthorne, NY, 10532.
EXT: (914) 784 - 5120
TL: 863- 5120
