Issue Details (XML | Word | Printable)

Key: XALANJ-2199
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Henry Zongaro
Reporter: Jens Elkner
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
XalanJ2

Xalan 2.7.0 Error parsing XPath expression

Created: 14/Sep/05 06:08 PM   Updated: 11/Dec/07 04:57 PM
Return to search
Component/s: XSLTC
Affects Version/s: 2.7
Fix Version/s: 2.7.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works patch.j2199.txt 2005-11-03 12:18 AM Henry Zongaro 4 kB
Text File Licensed for inclusion in ASF works patch.v2.j2199.txt 2005-11-03 12:33 AM Henry Zongaro 3 kB
Environment:
#---- BEGIN writeEnvironmentReport($Revision: 1.29 $): Useful stuff found: ----
version.DOM.draftlevel=2.0fd
java.class.path=/usr/apps/xalan/serializer.jar:/usr/apps/xalan/xalan.jar:/usr/apps/xalan/xercesImpl.jar:/usr/apps/xalan/xml-apis.jar:/usr/apps/docbook/xsl/1.69.1/extensions/xalan25.jar
version.JAXP=1.1 or higher
java.ext.dirs=/usr/apps/jdk1.5.0_04/jre/lib/ext
version.xerces2=Xerces-J 2.7.1
version.xerces1=not-present
version.xalan2_2=Xalan Java 2.7.0
version.xalan1=not-present
version.ant=not-present
java.version=1.5.0_04
version.DOM=2.0
version.crimson=not-present
sun.boot.class.path=/usr/apps/jdk1.5.0_04/jre/lib/rt.jar:/usr/apps/jdk1.5.0_04/jre/lib/i18n.jar:/usr/apps/jdk1.5.0_04/jre/lib/sunrsasign.jar:/usr/apps/jdk1.5.0_04/jre/lib/jsse.jar:/usr/apps/jdk1.5.0_04/jre/lib/jce.jar:/usr/apps/jdk1.5.0_04/jre/lib/charsets.jar:/usr/apps/jdk1.5.0_04/jre/classes
#---- BEGIN Listing XML-related jars in: foundclasses.java.class.path ----
serializer.jar-apparent.version=serializer.jar present-unknown-version
serializer.jar-path=/usr/apps/xalan/serializer.jar
xalan.jar-path=/usr/apps/xalan/xalan.jar
xercesImpl.jar-apparent.version=xercesImpl.jar from Xerces-J-bin.2.7.1
xercesImpl.jar-path=/usr/apps/xalan/xercesImpl.jar
xml-apis.jar-apparent.version=xml-apis.jar from head branch of xml-commons, tag: xml-commons-external_1_3_02
xml-apis.jar-path=/usr/apps/xalan/xml-apis.jar
#----- END Listing XML-related jars in: foundclasses.java.class.path -----
version.SAX=2.0
version.xalan2x=Xalan Java 2.7.0
#----- END writeEnvironmentReport: Useful properties found: -----
# YAHOO! Your environment seems to be OK.
Issue Links:
Duplicate
 

Xalan info: PatchAvailable
Reviewer: Yash Talwar
Resolution Date: 03/Dec/05 07:58 PM


 Description  « Hide
I'm trying to compile docbook XSL 1.69.1, however, xsltc fails with:

Compiler errors:
  Syntax error in '* or $generate.index != 0'.
  file:/usr/apps/docbook/xsl/1.69.1/xhtml/autotoc.xsl: line 294: Error parsing XPath expression '* or $generate.index != 0'.
  file:/usr/apps/docbook/xsl/1.69.1/xhtml/autotoc.xsl: line 294: Required attribute 'test' is missing.
  Syntax error in '* or $generate.index != 0'.
  file:/usr/apps/docbook/xsl/1.69.1/xhtml/autotoc.xsl: line 401: Error parsing XPath expression '* or $generate.index != 0'.
  file:/usr/apps/docbook/xsl/1.69.1/xhtml/autotoc.xsl: line 401: Required attribute 'test' is missing.

But the test attributes are there (e.g. autotoc.xsl):
294: <xsl:if test="* or $generate.index != 0">
...

But transformation with the "normal" processor, which uses this template as well works.

Refs:
http://mesh.dl.sourceforge.net/sourceforge/docbook/docbook-xsl-1.69.1.tar.gz
http://archive.apache.org/dist/xml/xalan-j/xalan-j_2_7_0-bin.tar.gz

Used commandline:
java -cp /usr/apps/xalan/serializer.jar:/usr/apps/xalan/xalan.jar:/usr/apps/xalan/xercesImpl.jar:/usr/apps/xalan/xml-apis.jar:/usr/apps/docbook/xsl/1.69.1/extensions/xalan25.jar org.apache.xalan.xsltc.cmdline.Compile -x /usr/apps/docbook/xsl/1.69.1/xhtml/chunk.xsl

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Henry Zongaro added a comment - 02/Nov/05 06:22 AM
This appears to be related to the fix for bug report XALANJ-1912. The token for "or" in the following expression is being treated as an NCName rather than as an operator because it's following an asterisk. The lexical analysis is assuming that the asterisk represents a multiplication operator in this case, rather than a wildcard.

  * or *

Henry Zongaro added a comment - 02/Nov/05 10:58 PM
I thought I'd elaborate on my previous comment. In an expression like the following, lexical analysis has to treat the first "or" token as a QName, because of its position in the expression, the second "or" token as an operator, because it follows a QName token, and the third "or" token as a QName because it follows an operator token.

  or or or

The lexical analyzer in XSLTC is using the same token to represent an asterisk that is used as a wildcard as it does to represent an asterisk that is used as a multiplication operator. So in the following pair of expressions, the "or" token is being treated as a QName because it follows an asterisk, which it is assuming must be a multiplication operator, but that's not the correct way of disambiguating the token in the second of those two expressions.

   elem * or
   * or *

Henry Zongaro added a comment - 03/Nov/05 12:19 AM

Henry Zongaro added a comment - 03/Nov/05 12:34 AM
Attached revised patch <http://issues.apache.org/jira/secure/attachment/12320448/patch.v2.j2199.txt> which corrects a copy and paste error in a comment.

Yash Talwar added a comment - 03/Dec/05 01:49 AM
I have reviewed the patch <http://issues.apache.org/jira/secure/attachment/12320448/patch.v2.j2199.txt>.
I have verified the conformance suit also.
The changes look good to me.

I approve the changes.

Thanks!

Henry Zongaro added a comment - 03/Dec/05 07:58 PM
Applied patch to Subversion repository.

Brian Minchau added a comment - 11/Dec/07 04:57 PM
Would the originator of this issue please verify that this issue is fixed in the 2.7.1 release, by adding a comment to this issue, so that we can close this issue.

A lack of response by February 1, 2008 will be taken as consent that we can close this resolved issue.

Regards,
Brian Minchau