Re: [xsl] finding position() in xpath 1.0

Subject: Re: [xsl] finding position() in xpath 1.0
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 19 Mar 2007 14:07:09 GMT
> can you say why
> results error 'Axis in pattern must be child or attribute'?

because you asked for an Xpath expression, and XSLT match patterns are
not XPath and have a completely separate grammar specified (although the
syntax is a subset of that of XPath). You can't use a  following-sibling
step in a pattern (other than inside a predicate, where any XPath may be
used).

The rewrite I just posted actually avoids the following-sibling::CELL[1]
step for other reasons, so would work as a pattern.

Note however that if your actual usage is as an xsl pattern then almost
certsinly none of these are really what you want to do. If you are
inside XSLT rather than just asking for a pure xpath solution there are
far better ways available, probably.

David

Current Thread