That is my understanding of the inner workings of XSLT.
It utilizes a parser, the W3 DOM model or a SAX-compliant one that converts the XML instance into a tree structure. Elements, attributes, etc. are all nodes on that tree, ones that XSL can navigate, select, and perform complex operations upon. As XSLT processes through the templates in a stylesheet, various nodes in the xML instance are accessed and transformed and an output tree is built in memory. When the templates in the stylesheet have all been processed, the result tree is serialized as output in whatever form the stylesheet specifies.
From: Encoded Archival Description List on behalf of MicheleR
Sent: Sun 4/17/2005 12:18 PM
To: [log in to unmask]
Subject: Re: I/O flow with XSLT
> You put your finger exactly on the difference in the last paragraph.
> XSLT is not a sequential processing language. It proceeds through
> the templates rather than the document, processing those parts of the
> document that relate to each template, and then putting the whole
> thing together at the end. It is the templates that are "processed" not
> the document.
Thanks, Michael, this was just the info I was looking for. Am I right in
thinking then that the first thing XSLT does it read in the entire XML
instance and store it in memory? And that it then works through the
templates as laid out in the style sheet, picking elements off the
memory-resident document tree as needed? In other words, no matter which
template is being processed, the transformation has access to the entire XML
instance at all times?
This is pretty slick.