On 29.11.2003 14:59, Mariusz Sieraczkiewicz wrote:

Hi Joerg,

BTW ".[4]" is an invalid XPath, should be "self::*[4]". But this one can not refer to any node as "self::*" (and also ".") always refer to exactly one node.

Thanks for adding your description to Bugzilla.


I'm afraid I don't understand your explaination. I can't see difference
between ".[4]" and "self::*". ".[4]" works in JXTemplateGenerator.
I'm not a XPath GURU so that I'd willingly hear an answer.

What shall I tell you more than it's simply not allowed ;-) I know it works with JXPath, but it should be reported as bug there. Try it with a conform XSLT processor like Xalan or Saxon.


From the spec (http://www.w3.org/TR/xpath):

'.' is an abbreviated step:
http://www.w3.org/TR/xpath#NT-AbbreviatedStep.

'[4]' is a predicate:
http://www.w3.org/TR/xpath#NT-Predicate

Predicates must not be used in combination with abbreviated steps. Predicates are only allowed after filter expressions (http://www.w3.org/TR/xpath#NT-FilterExpr) or node tests (http://www.w3.org/TR/xpath#NT-NodeTest). Both can not be led to abbreviated steps.

Does ".[4]" return anything? Even it's working with JXPath it should really *never* return anything, otherwise they have maybe another understanding of '.'.

Joerg



Reply via email to