xsl-list
[Top] [All Lists]

Re: [xsl] XSLT Streaming versus SAX and STaX?

2014-10-21 22:13:46
Apart from the pun-intended earlier answers from some list members, I think 
there is some merit in your question. In SAX, an XML source is processed top to 
bottom, depth-first. I have not worked with SAX recently, but I think it is a 
one-way street: only down.

Streaming XSLT is standardized with that idea in mind: one pass through the 
document and to achieve that, only downward selects are allowed (generally 
speaking).

I think the pattern that most closely resembles SAX, or at least can be mapped 
to it, is accumulators, which define an action to be taken and remembered when 
a certain pattern is matched (much like xsl:template, but with accumulators, 
the result becomes a property of the node, so that you can access it without 
having to go back if you need this node info later in the process). 

Generally speaking, what you can do with SAX, you can also do with streaming in 
XSLT 3.0, both give you enough tools at hand to process an XML document in a 
streaming way. I would, however, dare to think that XSLT is more suited for the 
task, as transformations are its natural habitat.

Also generally speaking: if you understand the model of SAX (or the .NET 
equivalent of XmlReader) then you will likely have less trouble understanding 
the logic and rules of XSLT streaming, whereas if you only ever used a DOM 
approach, adopting streaming will likely be much harder.

Cheers,
Abel Braaksma
Exselt XSLT 3.0 streaming processor
http://exselt.net

-----Original Message-----
From: Costello, Roger L. costello(_at_)mitre(_dot_)org [mailto:xsl-list-

How would you answer this question:

      Is XSLT streaming like SAX and STaX?
      How does it differ?

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

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