[xml] Read only XML tree



Hi all,

Just wondering. At the moment when you parse a 
document you can get multiple instances of the 
same "text" for example
--- tree fragment ---
 <doc>
  <node someattribute="1" />
  <node someattribute="1" />
 </doc>
------- end --------------
You get two copies of 'node', 'someattribute' 
and '1' 

If a document was guaranteed to be valid and to 
be treated as build once read many times what 
optimization are possible? Could there be a 
benifit of creating a pool of immutable strings 
that get shared (for node names, attribute names 
and attribute values)? It could be possible to 
allocate an "immutable string identifier" (unique 
integer value) to each of these strings which 
could be used to optimize XPath computations.

I'm not sure how this would be done, though I 
thought it might help the "brainstorming" being 
done at the moment on how to optimize libxml.

bye,

Keith Isdale





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]