[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Streaming terminology: Climbing
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|