[xsl] Design of XML so that it may be efficiently stream-processed

Subject: [xsl] Design of XML so that it may be efficiently stream-processed
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Fri, 22 Nov 2013 10:41:42 +0000
Hi Folks,

Consider XSLT code to process a node in the XML tree.

The rules of streaming say that the processing cannot utilize data from
preceding or following nodes. Further, the XSLT code can only access one child
(one downward selection rule).

Given those restrictions, I am led to the following XML design.

For each node:

1. Use lots of attributes. Store in them the data needed for processing the
node.

2. Have one child element only.

So, to enable efficient stream processing, design XML like this:

<root a="..." b="..." c="...">
      <node d="..." e="..." f="...">
            <node g="..." h="..." i="...">
                  <node j="..." k="..." l="...">
                        <node m="..." n="..." o="...">
                              <node p="..." q="..." r="...">
                                  ...
                             </node>
                        </node>
                  </node>
            </node>
      </node>
</root>

This results in a massively deep tree. For Gigabyte-sized XML files, the
nesting could be a billion levels deep (or more).

Do you agree with this XML design?

/Roger

Current Thread