xsl-list
[Top] [All Lists]

[xsl] Streaming terminology: Climbing

2014-01-24 04:15:57
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  

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


<Prev in Thread] Current Thread [Next in Thread>