DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20531>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20531

Variables not supported in <sort>

           Summary: Variables not supported in <sort>
           Product: XalanJ2
           Version: 2.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Apparently variables are not supported in a <sort> element. The following 
template demonstrates the problem:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template match="/">
    <TopNode>
      <xsl:for-each select=".">
        <xsl:variable name="foo" select="'bar'"/>
        <xsl:sort select="$foo"/>
        <InnerNode/>
      </xsl:for-each>
    </TopNode>
  </xsl:template>
</xsl:stylesheet>

This should sort the InnerNode's (well, since all of them will have the 
value 'bar', the'll be left in document order), but instead I get the 
exception "javax.xml.transform.TransformerConfigurationException: Could not 
compile stylesheet" when I try to precompile the transform because of the use 
of $foo within the select attribute of the sort element. As far as I can tell 
from the XSLT spec, this transform should be completely legal.

Reply via email to