You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "arn44 (JIRA)" <xa...@xml.apache.org> on 2005/04/20 14:14:24 UTC
[jira] Created: (XALANJ-2108) incorrect use of xsl:key cause NullPointerException
incorrect use of xsl:key cause NullPointerException
----------------------------------------------------
Key: XALANJ-2108
URL: http://issues.apache.org/jira/browse/XALANJ-2108
Project: XalanJ2
Type: Bug
Components: XSLTC
Versions: 2.6
Environment: windows jdk 1.42.06
Reporter: arn44
Priority: Minor
my stylesheet
-------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "html" encoding="iso-8859-1" />
<xsl:variable name = "x" select = "'1'" />
<xsl:variable name = "y" select = "'4'" />
<xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
<xsl:template match="/">
</xsl:template>
</xsl:stylesheet>
xml file
<test><date>2004-01-01</date></test>
java.lang.NullPointerException
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
at java.lang.Double.valueOf(Double.java:202)
at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
at ent_recherche_simple.buildKeys()
at ent_recherche_simple.transform()
at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
Re: [jira] Created: (XALANJ-2108) incorrect use of xsl:key cause NullPointerException
Posted by Mukul Gandhi <ga...@gmail.com>.
This seems a wierd way to define and use keys..
I would use keys as follows (I have adapted the example you gave) ..
XML file -
<test>
<date>2004-01-01</date>
<date>2005-01-02</date>
<date>2005-01-03</date>
<date>2004-01-04</date>
</test>
XSLT file -
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "text" />
<xsl:key name="key_test" match ="date" use = "substring(., 1, 4)" />
<xsl:template match="/test">
<xsl:for-each select="key('key_test', '2004')">
<xsl:value-of select="." /><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I get correct output -
2004-01-01
2004-01-04
I tested with Xalan-J 2.6.0 bundled with JDK 1.5.0_02 ..
But I do feel for the example you gave, that "error message can be
improved" .. I do not think it can be called a bug!
Regards,
Mukul
On 4/20/05, arn44 (JIRA) <xa...@xml.apache.org> wrote:
> incorrect use of xsl:key cause NullPointerException
> ----------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Type: Bug
> Components: XSLTC
> Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arn44
> Priority: Minor
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
>
> </xsl:template>
> </xsl:stylesheet>
>
> xml file
> <test><date>2004-01-01</date></test>
>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
>
> --
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Santiago Pericas-Geertsen (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_12449749 ]
Santiago Pericas-Geertsen commented on XALANJ-2108:
---------------------------------------------------
It is true that the patch only performs a simple static analysis to determine dependencies, but it is useful nonetheless. In particular, it makes the behavior of XSLTC more compatible with Xalan which does accept stylesheets with some dependencies. Besides, I believe the problem of static vs. dynamic circular references problem exists today (it is just the nature of the beast), even without applying this patch. Thus, I think we are better of having than not having this patch.
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Issue Type: Bug
> Components: XSLTC
> Affects Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assigned To: Santiago Pericas-Geertsen
> Priority: Minor
> Attachments: patch-2108-6401137.txt
>
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_12450518 ]
Brian Minchau commented on XALANJ-2108:
---------------------------------------
I had a classpath error, and I don't know what I was thinking when I said the output from
the interpreter was <test><date>2004-01-01</date></test>.
Sorry, sorry, sorry for the confusion.
Santiago's patch does ease the restriction and the testcase runs to completion, just like
the interpreter does. (without his patch I see the NullPointerException).
Also the patch passes the XSLTC smoketest. Just waiting a confirmation from Santiago that patch2 hasn't changed anything since his original patch before I approve/apply this one.
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Issue Type: Bug
> Components: XSLTC
> Affects Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assigned To: Santiago Pericas-Geertsen
> Priority: Minor
> Attachments: patch-2108-6401137.txt, patch-2108-patch2.txt, xalanj-2108.xml
>
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Santiago Pericas-Geertsen (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_12450767 ]
Santiago Pericas-Geertsen commented on XALANJ-2108:
---------------------------------------------------
I reviewed and approve the changes proposed by Brian for the original patch I proposed.
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Issue Type: Bug
> Components: XSLTC
> Affects Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assigned To: Santiago Pericas-Geertsen
> Priority: Minor
> Attachments: patch-2108-6401137.txt, patch-2108-patch2.txt, xalanj-2108.xml
>
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_12450278 ]
Brian Minchau commented on XALANJ-2108:
---------------------------------------
In reviewing Santiago's original patch I find that it doesn't fully take due to some code motion since it was
created.
All parts of the patch take, except for the second change in KeyCall.java which wanted to insert this:
// If in a top-level element, create dependency to the referenced key
addParentDependency();
just before
return returnType;
Just one other part of the patch wouldn't take, and that was the second sub-patch of Stylesheet.java which
wanted to change this:
// Resolve any forward referenes and translate global variables/params
_globals = resolveReferences(_globals);
final int count = _globals.size();
for (int i = 0; i < count; i++) {
final VariableBase var = (VariableBase)_globals.elementAt(i);
var.translate(classGen,toplevel);
}
// Compile code for other top-level elements
Vector whitespaceRules = new Vector();
into this:
// Create a new list containing variables/params + keys
Vector varDepElements = new Vector(_globals);
Enumeration elements = elements();
while (elements.hasMoreElements()) {
final Object element = elements.nextElement();
if (element instanceof Key) {
varDepElements.add(element);
}
}
// Determine a partial order for the variables/params and keys
varDepElements = resolveDependencies(varDepElements);
// Translate vars/params and keys in the right order
final int count = varDepElements.size();
for (int i = 0; i < count; i++) {
final TopLevelElement tle = (TopLevelElement) varDepElements.elementAt(i);
tle.translate(classGen, toplevel);
if (tle instanceof Key) {
final Key key = (Key) tle;
_keys.put(key.getName(), key);
}
}
// Compile code for other top-level elements
Vector whitespaceRules = new Vector();
elements = elements();
So I massaged the patch a little to produce patch2.txt which I am attaching.
Santiaogo, please verify that my patch2.txt is really the same as your original patch, just updated to
make it stick in those places.
Thanks,
Brian
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Issue Type: Bug
> Components: XSLTC
> Affects Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assigned To: Santiago Pericas-Geertsen
> Priority: Minor
> Attachments: patch-2108-6401137.txt, patch-2108-patch2.txt
>
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause NullPointerException
Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_63292 ]
Henry Zongaro commented on XALANJ-2108:
---------------------------------------
I believe the incorrect use you're referring to is the presence of variable references in the value of the "use" attribute. Is my understanding correct?
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Type: Bug
> Components: XSLTC
> Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arn44
> Priority: Minor
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Resolved: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=all ]
Brian Minchau resolved XALANJ-2108.
-----------------------------------
Fix Version/s: Latest Development Code
Resolution: Fixed
I applied the patch to the code base. The issue is resolved.
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Issue Type: Bug
> Components: XSLTC
> Affects Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assigned To: Santiago Pericas-Geertsen
> Priority: Minor
> Fix For: Latest Development Code
>
> Attachments: patch-2108-6401137.txt, patch-2108-patch2.txt, xalanj-2108.xml
>
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_12373193 ]
Brian Minchau commented on XALANJ-2108:
---------------------------------------
Comments from the Xalan-J triage April 4, 2006:
> In the XSLT 1.0 recommendation, in section 12.2 on xsl:key it says:
> "It is an error for the value of the use attribute or the match attribute
> to contain a VariableReference."
> That is the case for this issue. So the stylesheet is in error,
> and Xalan should have detected this error at parse time.
> Later at runtime it throws a null pointer exception.
>
> Previously Xalan gave the "expected" result, although the
> correct behavior is to have a parse time error.
>
> However, in the given testcase one can execute it correctly,
> it is possible to find the right order to initialize the variables
> and the keys.
>
> The problem in XSLTC is that that code to resolve circular dependancies
> within variables, does not include keys as part of the same logic.
> In the translet there is a different handling of varibles for keys.
>
> The consensus of the committers at the meeting was that we should
> relax the restriction in 12.2 and not report the error. More users
> would be upset if we strictly follow 12.2.
> stricter would probably upset more users, even if we are following
> 12.2. One needs to resolve dependencies between global variables is
> not really different than resolving varibles within keys.
>
> Santiago P.-G. has a patch. Henry Z. agreed to review.
> Santiago's patch does not cover more general casses.
> If you have global variables, one should ensure that they are
> evaluated in the right order so that any variable is defined before
> it is used. Sometimes determining the order can't be done statically
> because two variables might depend on each other and that might
> be only known at runtime.
>
> This bug is actually a bug that is not detected at compile time.
<xsl:variable name='x'>
<xsl:if select='{$foo}'>
<copy-of select='{$y}'>
</xsl:if>
</xsl:variable>
<xsl:variable name='y'>
<xsl:if select='{$goo}'>
<copy-of select='{$x}'>
</xsl:if>
</xsl:variable>
> If both '{$foo}' and '{$goo}' evaluate to true then we have a circular
reference between global variables, but only detectable at runtime.
> Santiago's patch will not cover this runtime case that is not detectable
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Type: Bug
> Components: XSLTC
> Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assignee: Santiago Pericas-Geertsen
> Priority: Minor
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause NullPointerException
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_64383 ]
Brian Minchau commented on XALANJ-2108:
---------------------------------------
The element:
<xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
is using a variable reference, $x and $y which is not permitted. XSLTC is not detecting this at parse time, which it should, and later throws an exception at runtime.
Marking this as fp4 per the Xalan-J issue meeting on May 3, 2005.
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Type: Bug
> Components: XSLTC
> Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arn44
> Priority: Minor
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause NullPointerException
Posted by "arn44 (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_63300 ]
arn44 commented on XALANJ-2108:
-------------------------------
Yes. The incorrect use is the presence of variable references in the value of the "use" attribute.
An error message would be welcome.
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Type: Bug
> Components: XSLTC
> Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arn44
> Priority: Minor
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Assigned: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Santiago Pericas-Geertsen (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=all ]
Santiago Pericas-Geertsen reassigned XALANJ-2108:
-------------------------------------------------
Assign To: Santiago Pericas-Geertsen
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Type: Bug
> Components: XSLTC
> Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assignee: Santiago Pericas-Geertsen
> Priority: Minor
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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
[jira] Commented: (XALANJ-2108) incorrect use of xsl:key cause
NullPointerException
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2108?page=comments#action_12450281 ]
Brian Minchau commented on XALANJ-2108:
---------------------------------------
Using the stylesheet and xml in the description, as xalanj-2108.xsl
and xalanj-2108.xml respectively and the Process command line with these args:
-XSLTC -IN xalanj-2108.xml -XSL xalanj-2108.xsl
The output was this:
(Location of error unknown)org/apache/regexp/RESyntaxException
(Location of error unknown)Could not compile stylesheet
(Location of error unknown)XSLT Error (javax.xml.transform.TransformerConfigurationException): Could not compile stylesheet
Exception in thread "main" java.lang.RuntimeException: Could not compile stylesheet
at org.apache.xalan.xslt.Process.doExit(Process.java:1155)
at org.apache.xalan.xslt.Process.main(Process.java:1128)
The result was the same with or without patch2, so I don't see what the patch fixes.
For these args (Xalan interpretive):
-IN xalanj-2108.xml -XSL xalanj-2108.xsl
the output was this:
<test><date>2004-01-01</date></test>
So I don't know what error XSLTC is hitting at this point, but I can't approve the fix since I can't see
what it is fixing.
- Brian
The output was this:
> incorrect use of xsl:key cause NullPointerException
> ---------------------------------------------------
>
> Key: XALANJ-2108
> URL: http://issues.apache.org/jira/browse/XALANJ-2108
> Project: XalanJ2
> Issue Type: Bug
> Components: XSLTC
> Affects Versions: 2.6
> Environment: windows jdk 1.42.06
> Reporter: arnaud
> Assigned To: Santiago Pericas-Geertsen
> Priority: Minor
> Attachments: patch-2108-6401137.txt, patch-2108-patch2.txt
>
>
> my stylesheet
> -------------
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method = "html" encoding="iso-8859-1" />
>
> <xsl:variable name = "x" select = "'1'" />
> <xsl:variable name = "y" select = "'4'" />
> <xsl:key name = "key_test" match ="test" use = "substring(date, $x, $y)" />
>
> <xsl:template match="/">
> </xsl:template>
> </xsl:stylesheet>
> xml file
> <test><date>2004-01-01</date></test>
> java.lang.NullPointerException
> at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
> at java.lang.Double.valueOf(Double.java:202)
> at org.apache.xalan.xsltc.runtime.BasisLibrary.stringToReal(BasisLibrary.java:838)
> at ent_recherche_simple.buildKeys()
> at ent_recherche_simple.transform()
> at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
--
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