RE: [libxml++] libxml++ future



On Mon, 2003-09-29 at 04:33, Murray Cumming wrote:
> On Fri, 2003-09-26 at 17:39, Dan Dennedy wrote:
> > On Fri, 2003-09-26 at 11:15, Murray Cumming Comneon com wrote:
> > > > From: Dan Dennedy [mailto:dan dennedy org] 
> > > > I am also personally interested in entity-support in the near term.
> > > 
> > > As you know, I'm willfully ignorant. Could you tell us more about what you
> > > would like the API to do for this?
> > 
> > For now, I just need to be able to manually add them from the sax parser
> > in my custom DOM
> 
> By the way, let's get that custom_dom example into libxml++. But I'd
> prefer to call it derived_dom_parser, because I think that's what it is.

Not exactly; it is more literally derived_sax_parser plus dom_build.
Maybe simply derived_dom is best.

> >  --it always goes back to that! So, I would need the SAX
> > event exposed, and a very simple node subclass.
> 
> So I think a large part of this is: Adding 
> class Entity : public Node
> and telling libxml to give us Entities instead of substituting them. I
> think there's some libxml function for that. (We should add the option
> to libxml++ as well).

I did some work over the weekend. I extended SaxParser with internal
subset, entity declaration, and entity reference callbacks. In my parser
implementation, I also implemented the getEntity callback and told
SaxParser to use it, but I was curious about the difference between
getEntity and reference. I was able to get everything working except for
keeping entity references in tact--at least as far as xml serialization
is concerned. I need to anaylze the resultant node tree further to see
if content is a list of text and entity reference nodes. Either,
libxml2, encodes entity references from "&ref;" to "&ref;" or I can
set resolveEntities=1 in the libxml2 parser context to make it expand.
The SAX reference callback is never called upon.

Also, I still need to subclass Node as Entity in order to prevent a
libxml2 xmlEntity* from being a part of the interface.

> > I am curious, has there been any discussion of W3C DOM API conformance?
> 
> Do you mean the thing that the Xerces-C++ people proposed?

I don't know anything about that, but xerxes is DOM-compliant. See
http://w3.org/DOM/
specifically
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/idl-definitions.html

I suppose you are referring to
http://xml.apache.org/xerces-c/ApacheDOMC++BindingL2.html
It is somewhat nice to have a familiar API--e.g., I have much prior
experience with MSXML, which is also DOM compliant. OTOH, freedom to
explore a different approach is also nice.

Further to the traversal discussion, there are ideas from the DOM Level
2 Traversal and Range Specification--both the W3C spec and the Apache
C++ bindings.







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