[xml] Pseudo object oriented design in libxml



  Hello,

 I'm working on an application that needs to have
access to very large documents. Since I don't need
to have the whole doc in memory at a time (I'm
using xpath to select nodes of interest) I was
looking for a clean way to add persistent storage to
libxml. 

 Here is what I have think of :

- core structures should be opaque, so that their
  fields will not be manipulated directly. Exemples
  of such fields are next, prev, children, doc in
  _xmlNode.

- these structures should contains get/set functions
  for each field. So the allocation method can use
  one kind of method (default : return value, persistent :
  get value from datastore).

- this kind of design (used for instance in berkeley db) 
  leads to code like :

 while ((cur = cur->getNext(cur)) != NULL) {
 ...
 }
 
 instead of
 
 while ((cur = cur->next) != NULL) {
 ...
 }
 
  I understand that this breaks API compatibility with the
existing applications, but this will really open new
horizons for libxml. For instance plugin libxslt on top
of a persistent storage should give a powerful retrieval
engine.
  
  Does it sound silly or can it be part of libxml3 (you see,
I have no hope for a libxml2 object version...)

 Regards,

        Eugène




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