Lists Home |
Date Index |
Simon Kissane wrote:
> But a breadth-first serialization could be something like:
> 1 0 Root
> 2 1 ElementA
> 3 1 ElementC
> 4 2 ElementB1
> 5 2 ElementB2
> 6 3 ElementD
> 7 4 "Some text"
I have also been thinking in that direction before. I belive, that
tis approach might only be usefull in drill-down scenarios.
I was playing with the idea of using a similar representation as a
kind of index for an existing XML file, by adding a reference to the
position of the element in the original text serialization. An
application could thus quickliy scan the data for an element of interest
and then use the reference pointer to extract the required subtree via
DOM or SAX.
I also imagined that transformers could benefit from such an index,
since lookups of nodes from different parts of the document could be
done without constructing large internal trees containing unneeded depth.
Did you find any other use-cases besides the drill-down scenario in
which this kind of representaion might be helpful? I would view this
rather as a kind of augmented representaion than as an alternative one,
since it sacrafices too much of the benefits of the normal XML
Lars Oppermann <firstname.lastname@example.org> Sun Microsystems
Software Engineer - StarOffice Sachsenfeld 4
Phone: +49 40 23646 959 D-20097 Hamburg
Fax: +49 40 23646 550 http://www.sun.com/staroffice