xsl-list
[Top] [All Lists]

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

2013-11-22 04:41:59
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--