Message: A new issue has been created in JIRA.
--------------------------------------------------------------------- View the issue: http://issues.apache.org/jira/browse/XALANJ-1942 Here is an overview of the issue: --------------------------------------------------------------------- Key: XALANJ-1942 Summary: NPE on sorting using a variable Type: Bug Status: Unassigned Priority: Blocker Project: XalanJ2 Components: Xalan Versions: 2.6 Assignee: Reporter: Paolo Noya Created: Tue, 14 Sep 2004 2:10 AM Updated: Tue, 14 Sep 2004 2:10 AM Description: Similar to issue n. 1577 I've a problem during sort node with xalan-j version 2.6.0 and also with 2.4.1(bundle with jdk 1.4.2_05). I have an XML like this: <?xml version="1.0"?> <Peoples> <Person> <Name>Johnson</Name> <Level>foo</Level> </Person> <Person> <Name>Smith</Name> <Level>baz</Level> </Person> <Person> <Name>White</Name> <Level>foo</Level> </Person> <Person> <Name>Brown</Name> </Person> <Person> <Name>Black</Name> <Level>bar</Level> </Person> </Peoples> ======================= and I want sort by level and then by name giving a rule for mapping level with an arbitrary number. I wrote an xml like this: ======================= <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:this="http://localhost/" exclude-result-prefixes="this" > <this:Levels> <Level pos="0"/><!--dummy level--> <Level pos="1">foo</Level> <Level pos="2">bar</Level> <Level pos="3">baz</Level> </this:Levels> <xsl:variable name="levels" select="document('')/xsl:stylesheet/this:Levels"/> <xsl:template match="/Peoples"> <xsl:apply-templates select="Person"> <xsl:sort data-type="number" select="number($levels/Level[.=current()/Level]/@pos)"/> <xsl:sort select="Name"/> </xsl:apply-templates> </xsl:template> <xsl:template match="Person"> <xsl:value-of select="Name"/> </xsl:template> </xsl:stylesheet> ======================= during transfom, the element <xsl:sort data-type="number" select="number($levels/Level[.=current()/Level]/@pos)"/> produce an excepiton javax.xml.transform.TransformerException: java.lang.NullPointerException If i print the <xsl:value-of select="number($levels/Level[.=current()/Level]/@pos)"/> in "Person" template I got the correct value. Other parsers give me the correct result. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
