[ 
http://issues.apache.org/jira/browse/XALANJ-1912?page=comments#action_62251 ]
     
Brian Minchau commented on XALANJ-1912:
---------------------------------------

This is a valid problem, and it has to do with the way the parser for the XPath 
grammer is implemented. It is implemented using reserved words for tokens like 
"and", "or".

A Java equivalent of Lex (Lex/YACC) is being used. Lex has a 'state' option 
where reseved words don't matter (pointed out by John G.). Not sure if the Java 
equivalent of Lex has this feature.

It needs to make allowances for those words to appear in QNames in appropriate 
places, and it isn't doing that right now. Don't know how difficult this is to 
fix.

Workaround arounds are cumbersome, such as rather than matching on the QName 
"and", match against *[name()='and']


> match="and" causes error - doesn't comply with XPath spec section 3.7
> ---------------------------------------------------------------------
>
>          Key: XALANJ-1912
>          URL: http://issues.apache.org/jira/browse/XALANJ-1912
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Versions: 2.6
>  Environment: Operating System: Other
> Platform: PC
>     Reporter: Michał Borowiecki
>     Priority: Critical

>
> Trying to compile a stylesheet with 'template match="and"' or with 'template
> match="or"' causes an error. The compiler reports a syntax error. Probably it
> interprets the expression "and" as an OperatorName.
> However, the XPath spec in section 3.7 (http://www.w3.org/TR/xpath#exprlex)
> states clearly that a token must not be recognized as an OperatorName unless
> there is a preceding token (other than @, ::, (, [, , or an Operator).
> In the expression "and" there is only one token (namely "and"). There is no
> preceding token, so the token "and" must NOT be recognized as an OperatorName!
> Instead it should be recognized as a NameTest, matching an XML element named 
> "and". 
> The same applies to "or".
> Regards,
> Michał Borowiecki

-- 
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]

Reply via email to