You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Pascal Bricard <pb...@sambatechnologies.com> on 2000/06/15 18:25:42 UTC

Xalan C++, problem with ancestor-or-self and ancestor ? (following)

Paul,

the XPath spec tells that :

"the ancestor axis contains the ancestors of the context node; the
ancestors of the context node consist of the parent of context node and the
parent's parent and so on; thus, the ancestor axis will always include the
root node, unless the context node is the root node."

and :

"the ancestor-or-self axis contains the context node and the ancestors of
the context node; thus, the ancestor axis will always include the root node."

Which means that the XPath expression "ancestor-or-self::*" should select a
node-set that contains :
 - the context node,
 - its parent, its parent's parent and so on,
 - the root node.

So i should be able to walk through this node-set using <xsl:for-each
select="ancestor-or-self::*"> for processing each node of this set : for
example in order to retrieve each node name with the name() function.

But it seems that with the Xalan C++ tool, "ancestor-or-self::*" selects
only the context node, and "ancestor::*" selects only the parent node.

Am i wrong ?

Thanks for help,

Pascal