Re: [xsl] XSLT streaming: the processor "remembers" things as it descends the XML tree?

Subject: Re: [xsl] XSLT streaming: the processor "remembers" things as it descends the XML tree?
From: Michael Sokolov <msokolov@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Nov 2013 17:21:06 -0500
It's certainly an imaginable situation to have a very deep document, but very unusual. Is it for purely cultural reasons? For example in some information-theoretic sense, this document might be said to encode a sequence of nodes:

<a>1<a>2<a>3</a></a></a>

in much the same way as this one:

<doc><a>1</a><a>2</a><a>3</a></doc>

just along a different axis (and without the need for the wrapping <doc> element).

For some reason nobody seems to do that though. I suspect there are structural impediments (other than the streaming), or is it purely convention?

To address Roger's original question though, you really often *do* want the ancestor info to be retained while streaming. Consider chunking a large book in which you'd like to include pointers back to the original document structure, and metadata from enclosing sections. That was exactly my use case when I hand-coded streaming processing using SAX, and I retained not only the ancestors but also /ancestor::*/preceding-sibling::* (to capture the metadata)

-Mike

, but the consequence of *not* rem
On 11/20/2013 04:00 PM, Dimitre Novatchev wrote:
On Wed, Nov 20, 2013 at 7:25 AM, Wendell Piez <wapiez@xxxxxxxxxxxxxxx> wrote:
I think it would be very interesting to see a survey of how deep XML
documents go in the wild. Except for pathological cases, I think they
would rarely go beyond 20 deep. Of course this will vary a great deal
by document type.
I think that what Roger points out is useful:  probably the concept of
"streaming" needs to be redefined and something needs to be specified
about a limit of the "maximum document depth".

Ignoring this leaves us with what actually could serve as the base for
yet another type of DOS attack. Not only malicious, but just
accidental -- imagine a buggy program failing to write closing element
tags ...

Current Thread