| « Indexing Fragments Versus Indexing Nodes | Defining Indices » |
Feverish Notes on Serialized DOM
March 17th, 2007An ideal DOM, with a small footprint would write the file flat, and read it into an array.
Any DOM could be made easier if Bento could divide into blocks and there was a way to read across blocks, as one contiguous output stream.
This low memory answer would be somewhat like tiny tree. An array of nodes, rather than a tree. The arrays are gathered into a linked list. A node wraps a reference to a list node an index into the list node. At regular offsets in the list node, one has an indication of the depth or the index of the parent, so that it is easy to find your way back up the tree. When an array is broken, an offset is adjust so that these things can still be found.
Writing out the array mends it. It gets written out in the clean format, the broken arrays discarded and reread.
comments

