Subject: Re: [xsl] 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
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"?
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?
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?
-- 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 |