Hi,

    actually i am working on an XPath version meant to work with Xerces 2.x 
DOM documents.

    First some remarks on the Xerces 2.x DOM interfaces ("c++ binding for 
DOM"): in my opinion Xerces should have seperated the 1.x version 
completely from the 2.x versions, not allowing in Xerces 2.x the building 
of /deprecated DOM documents, since these are not compatible with the 2.x 
documents. Nevertheless i am really comfortable with the 2.x interfaces, 
since they are an almost 1:1 "implementation" of the w3c recommendations 
(or WDs). This makes Xerces much more accessible to scripting languages 
such as python or vb. Actually i have rewritten the actual COM wrapper to 
adhere to the w3c recommendations (and the apache c++ binding) rather than 
to the MSXML interfaces. I would be glad to integrate this binding as 
alternative to the actual binding in Xerces as soon as it as i am satisfied 
with the tests. I personnaly hope that other XML workhorses such as Mozilla 
or OpenOffice will adopt sooner or later the Apache c++ bindings.

    Problems i encountered with the Xerces 2.x interfaces:

    1) There are a few const-ness glitches or a lost reference between all 
the pointers. I'll soon post these as bug (or is there already such a bug?)
    2) some of the exposed methods aren't yet implemented in Xerces, in 
particular the DOM textContent method: i do not understand why the getter 
returns always NULL whereas the setter throws not implemented. I'd expect 
the getter to throw not implemented as well.
    3) The memory model isn't well documented. What does release()? Is it 
basically a delete this, or do i have to delete a relased() pointer as well?
    4) I don't get NODE_DELETED calls when a whole document is released (or 
a DOMBuilder). This can be fatal for wrapper classes having a 'lazier' 
memory model such as COM. I will probably attach this one to my feature 
request about NODE_DELETED already present at bugzilla (all UserData items 
should be notified before the items are removed from the tree).

    Now about porting XPath: i'd like to see for XPath an Apache c++ 
binding as well, conformant to the DOM L3 XPath WD. This in some way can be 
a bitch, since XPath is part of xsl transform (Xalan) as well as a DOM 
specification (Xerces). It is clear that having two XPath libraries should 
be avoided.

    Issues encountered when porting (work yet in progress):

    1) The biggest problem with porting comes from the different string 
handling between Xerces (XMLCh *) and Xalan (XalanDOMString). My first 
draft of the porting actually uses always Xalan-strings (which means many 
unnecessary string copies), but i think i'll remove all of it.
    2) Xalan uses a lot of references instead of pointers. References can 
be a pain when it comes to templating (at least in vc) and the Apache 
bindings prefer pointers as well.
    3) XPath becomes slimmer when it comes to navigating through the DOM 
tree, since DOM L3 as handy methods such as compareTreePosition.

    Note anyhow that i was able in only one day to compile half of the 
XPath files simply using ugly hacks such as #define XalanNode DOMNode etc. 
The only real pain are the already mentioned XalanDOMStrings.

    Regards

    Thomas Blatter


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to