[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT streaming: the processor "remembers" things a

Subject: Re: XSLT streaming: the processor "remembers" things as it descends the XML tree?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Nov 2013 08:38:07 -0500
Re:  XSLT streaming: the processor "remembers" things a
At 2013-11-20 10:42 +0000, Costello, Roger L. wrote:
Consider an XSLT program that is at some node. The XSLT streaming rules say that the following nodes are accessible from that node: its ancestors and their attributes and namespaces, and its descendants and their attributes and namespaces.

If my XSLT program accesses ancestor nodes, that seems to require the XSLT processor to back up. And isn't that a violation of the fundamental law of streaming, "The XSLT processor shall not back up"?

I don't think so ... you haven't finished with that ancestor yet, so you really haven't left it. It is still "open" in that you are still in the process of acting on that ancestor. I think "backing up" is the issue only once you have left the node and moved on. In the case of ancestors, you haven't left them yet.


Or, perhaps my XSLT program can access ancestor nodes because, as the XSLT processor descends the XML tree it keeps a record of each node through which it descends (the node's name, its attributes, its namespaces). Yes, that must be what the XSLT processor does. Suppose that my XML tree is very deep, then the XSLT processor will have to remember a lot of stuff, right? In the extreme case, every node in the XML document has no siblings, just one child. Thus, the XSLT processor would have to remember the entire XML document, right?

I think you are putting too much into "remembering" for ancestors. And XML documents are typically flat (though my course material happens to go quite deep).


I think streaming is a benefit for flatter XML documents ... I certainly would not think that a skinny and deep XML document with only one leaf node and the thousands of branches would be seen in the wild, nor would it benefit from streaming.

Questions:

1. In XSLT streaming the processor "remembers" things as it descends the XML tree, right?

2. In XSLT streaming, allowing access to ancestors seems like a bad idea, for the reasons described above. What is the rationale for allowing access to ancestors?

Because ancestors are still handy because you haven't left them yet. You only leave a node once you've processed the end of the node. You haven't reached the end of any of your ancestors yet.


I hope this helps.

. . . . . . . . . Ken


-- Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 | Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.