You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by xa...@xml.apache.org on 2004/09/14 11:11:38 UTC
[jira] Created: (XALANJ-1942) NPE on sorting using a variable
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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Commented: (XALANJ-1942) NPE on sorting using a variable
Posted by xa...@xml.apache.org.
The following comment has been added to this issue:
Author: Paolo Noya
Created: Fri, 8 Oct 2004 2:10 AM
Body:
Hi Yash, Hi Brian
I tried the patch and all work fine!
Thanks very much for your support.
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/XALANJ-1942?page=comments#action_53834
---------------------------------------------------------------------
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: Resolved
Priority: Blocker
Resolution: FIXED
Project: XalanJ2
Components:
Xalan
Fix Fors:
2.6
Versions:
2.6
Assignee:
Reporter: Paolo Noya
Created: Tue, 14 Sep 2004 2:10 AM
Updated: Fri, 8 Oct 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Resolved: (XALANJ-1942) NPE on sorting using a variable
Posted by xa...@xml.apache.org.
Message:
The following issue has been resolved as FIXED.
Resolver: Brian Minchau
Date: Wed, 6 Oct 2004 1:18 PM
Patch patch.1942.txt was applied to CVS, please verify the fix.
---------------------------------------------------------------------
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: Resolved
Priority: Blocker
Resolution: FIXED
Project: XalanJ2
Components:
Xalan
Fix Fors:
2.6
Versions:
2.6
Assignee:
Reporter: Paolo Noya
Created: Tue, 14 Sep 2004 2:10 AM
Updated: Wed, 6 Oct 2004 1:18 PM
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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Updated: (XALANJ-1942) NPE on sorting using a variable
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-1942?page=all ]
Brian Minchau updated XALANJ-1942:
----------------------------------
Fix Version: 2.7
(was: 2.6)
> NPE on sorting using a variable
> -------------------------------
>
> Key: XALANJ-1942
> URL: http://issues.apache.org/jira/browse/XALANJ-1942
> Project: XalanJ2
> Type: Bug
> Components: Xalan
> Versions: 2.6
> Reporter: Paolo Noya
> Priority: Blocker
> Fix For: 2.7
> Attachments: Patch.txt, patch.1942.txt
>
> 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.
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org