[ http://issues.apache.org/jira/browse/XALANJ-2213?page=comments#action_12357407 ]
Cliff Huggins commented on XALANJ-2213: --------------------------------------- This incident can be closed. The error is caused by the JVM version being used and not Xalan XSLTC. JDK j2sdk1.4.2_03 had a bug that caused this problem. Is fixied in j2sdk1.4.2_10. > Error Parsing XPath Expressin - NumberFormatException > ----------------------------------------------------- > > Key: XALANJ-2213 > URL: http://issues.apache.org/jira/browse/XALANJ-2213 > Project: XalanJ2 > Type: Bug > Components: XSLTC > Versions: 2.5, 2.7 > Environment: #---- BEGIN writeEnvironmentReport($Revision: 1.23 $): Useful > stuff found: ---- > version.DOM.draftlevel=2.0fd > java.class.path=".;.;c:\work\JBoss\bin\run.jar;." > version.JAXP=1.1 or higher > java.ext.dirs=c:\work\j2sdk1.4.2_03\jre\lib\ext > #---- BEGIN Listing XML-related jars in: foundclasses.sun.boot.class.path ---- > xalan.jar-path=c:\work\hcs\lib\endorsed\xalan.jar > xercesImpl.jar-apparent.version=xercesImpl.jar from xerces-2_4 > xercesImpl.jar-path=c:\work\hcs\lib\endorsed\xercesImpl.jar > xml-apis.jar-apparent.version=xml-apis.jar present-unknown-version > xml-apis.jar-path=c:\work\hcs\lib\endorsed\xml-apis.jar > #----- END Listing XML-related jars in: foundclasses.sun.boot.class.path ----- > version.xerces2=Xerces-J 2.4.0 > version.xerces1=not-present > version.xalan2_2=Xalan Java 2.5.2 > version.xalan1=not-present > version.ant=Apache Ant version 1.5.2 compiled on February 28 2003 > java.version=1.4.2_03 > version.DOM=2.0 > version.crimson=present-unknown-version > sun.boot.class.path=c:\work\hcs/lib/endorsed\xalan.jar;c:\work\hcs/lib/endorsed\xercesImpl.jar;c:\work\hcs/lib/endorsed\ > xml-apis.jar;c:\work\j2sdk1.4.2_03\jre\lib\rt.jar;c:\work\j2sdk1.4.2_03\jre\lib\i18n.jar;c:\work\j2sdk1.4.2_03\jre\lib\s > unrsasign.jar;c:\work\j2sdk1.4.2_03\jre\lib\jsse.jar;c:\work\j2sdk1.4.2_03\jre\lib\jce.jar;c:\work\j2sdk1.4.2_03\jre\lib > \charsets.jar;c:\work\j2sdk1.4.2_03\jre\classes > version.SAX=2.0 > version.xalan2x=Xalan Java 2.5.2 > #----- END writeEnvironmentReport: Useful properties found: ----- > Reporter: Cliff Huggins > > Very Intermittent problem. Running in JBoss with JDK 1.4.2_03. Occurs at > JVM startup and usually on the first > stylesheet compile. Once in failure mode, most all stylesheets will get > errors. Stop and retart the JBoss JVM and > the problem will go away. Have seen failure mostly in Xalan 2.5.2, but I > believe we did see it in 2.7.0 once. Still > trying to get a failure in 2.7.0. The failing template is at the end. We > had a test loop compiling this template. > Changing it on the fly by adding a space after the 999 in the test expression > allows it to compile correctly. > The trace below looks like there is a length error in the expression string > --- "999PRESSION" > <10/12/05 14:56:50.081 MDT> <Debug> <Resource Name = > screens/main/KeywordSearch.xsl> > <10/12/05 14:56:50.081 MDT> <Debug> <Resource Name Out = > /screens/main/KeywordSearch.xsl> > java.lang.NumberFormatException: For input string: > "999PRESSION>string-length('foo') > 999" > at > java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) > at java.lang.Long.parseLong(Long.java:403) > at java.lang.Long.<init>(Long.java:630) > at > org.apache.xalan.xsltc.compiler.XPathLexer.next_token(XPathLexer.java:834) > at java_cup.runtime.lr_parser.scan(lr_parser.java:335) > at java_cup.runtime.lr_parser.parse(lr_parser.java:563) > at > org.apache.xalan.xsltc.compiler.XPathParser.parse(XPathParser.java:1047) > at > org.apache.xalan.xsltc.compiler.Parser.parseTopLevel(Parser.java:1119) > at > org.apache.xalan.xsltc.compiler.Parser.parseExpression(Parser.java:1080) > at org.apache.xalan.xsltc.compiler.If.parseContents(If.java:99) > at > org.apache.xalan.xsltc.compiler.Stylesheet.parseOwnChildren(Stylesheet.java:583) > at > org.apache.xalan.xsltc.compiler.Stylesheet.parseContents(Stylesheet.java:555) > at org.apache.xalan.xsltc.compiler.Parser.createAST(Parser.java:421) > at org.apache.xalan.xsltc.compiler.XSLTC.compile(XSLTC.java:365) > at org.apache.xalan.xsltc.compiler.XSLTC.compile(XSLTC.java:450) > at > org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:692) > at > com.thc.ids.application.hcs.modules.actions.main.TestXSLTC.compileTemplates(TestXSLTC.java:132) > at > com.thc.ids.application.hcs.modules.actions.main.TestXSLTC.compileTemplateTest(TestXSLTC.java:85) > ........................ > ERROR: 'line 4: Error parsing XPath expression 'string-length('foo') > 999'.' > FATAL ERROR: 'Could not compile stylesheet' > Failing stylesheet: > <?xml version="1.0" encoding="ISO-8859-1"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > <xsl:output method="xml" omit-xml-declaration="yes" encoding="ISO-8859-1"/> > <xsl:if test="string-length('foo') > 999" /> > </xsl:stylesheet> > Inserting a space between 999 and the ending quote makes it compile correctly. > <?xml version="1.0" encoding="ISO-8859-1"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > <xsl:output method="xml" omit-xml-declaration="yes" encoding="ISO-8859-1"/> > <xsl:if test="string-length('foo') > 999 " /> > </xsl:stylesheet> -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
