[xsl] Streaming terminology: Climbing

Subject: [xsl] Streaming terminology: Climbing
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Fri, 24 Jan 2014 10:15:38 +0000
Hi Folks,

I'd like to move on to the next term, "climbing".

The spec defines it this way:

	Climbing: indicates that nodes returned by the
	construct are reached by navigating the parent,
	ancestor[-or-self], attribute, and/or namespace
	axes from the node at the current streaming
	position. When the context posture is climbing,
	use of certain axes such as parent and ancestor
	is permitted, but use of other axes such as child
	or descendant violates the streamability rules.

Let's take an example. Let's suppose that an XSLT program is stream-processing
this XML document:

<Book xmlns="http://www.book.org";>
    <Chapter id="abc">
        <Title xml:lang="EN">Hello World</Title>
    </Chapter>
</Book>

Suppose that the context node is the <Title> element (that is, the current
streaming position is the <Title> element).

What nodes can a construct return in order for it to be considered a climbing
construct?

This XPath expression

	@*

returns all the attributes of the context node, so  @*  is a climbing
construct, correct?

This XPath expression

	ancestor::*

returns all the ancestors of the context node, so  ancestor::*  is a climbing
construct, correct?

This XPath expression

	for $i in ancestor::node() return $i

also returns all the ancestors of the context node, so  for $i in
ancestor::node() return $i  is a climbing construct, correct?

This XPath expression

	../@*

returns all the attributes of the parent of the context node, so  ../@*  is a
climbing construct, correct?

This XPath expression

	./namespace::*

returns all the namespaces visible on the context node, so  ./namespace::*  is
a climbing construct, correct?

Notice that all the examples are XPath expressions. Can you give an example or
two of a climbing construct that is not an XPath expression?

To recap:

	A construct is climbing if, when executed, it yields
	the context node (self) or ancestors of the context node.
	Also a climbing construct can return attributes of
	the context node or attributes of ancestor nodes.
	Finally, a climbing construct can return namespaces
	that are visible on the context node or on any ancestor.

Is that correct?

Is there anything else important to know about understanding what a climbing
construct is?

/Roger

Current Thread