lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Which is the best C++ wrapper for libxml2?


From: Vadim Zeitlin
Subject: Re: [lmi] Which is the best C++ wrapper for libxml2?
Date: Wed, 8 Nov 2006 15:42:31 +0100

On Wed, 08 Nov 2006 04:27:01 +0000 Greg Chicares <address@hidden> wrote:

GC> Should we use the latest version of xmlwrapp instead of libxml++ ?

 Short answer: I don't think so.

GC> It hasn't really vanished: it lives on, though dormantly, here:
GC>   http://sourceforge.net/projects/xmlwrapp/

 We knew that it wouldn't vanish, but we were afraid that it wouldn't be
maintained any longer which does seem to be the case.

GC> as well as in *nix distros like:
GC>   
http://www.mirrorservice.org/sites/ftp.freebsd.org/pub/FreeBSD/distfiles/%5Bpage=159%5D
GC> 
GC> > The libxml++ library
GC> > seems like a plausible candidate.
GC> 
GC> Now libxml++ seems to be dormant--see this message from a month ago:
GC>   http://sourceforge.net/mailarchive/message.php?msg_id=37044159

 I was indeed unpleasantly surprised to read this. But I think libxml++ is
still better in long-term as it is part of Gnome project and it already
changed maintainer in the past so I believe it's more likely that someone
else will continue to maintain it rather than xmlwrapp which seems to be a
one-person project.

GC> [2] Parse a file and get the DOM root node. Code to set libxml2
GC> options (e.g., validation and entity substitution) suppressed.
GC> 
GC> xmlwrapp:
GC> 
GC>   try {
GC>     xml::tree_parser parser(filename);
GC>     if(parser)
GC>       xml::node &root = parser.get_document().get_root_node();
GC>     }
GC> 
GC> libxml++ :
GC> 
GC>   try {
GC>     xmlpp::DomParser parser;
GC>     parser.parse_file(filename);
GC>     if(parser)
GC>       const xmlpp::Node* pNode = parser.get_document()->get_root_node();
GC>     }

 The code seems pretty similar to me in both cases to be honest...

GC> In the libxml++ example, I believe that either of these
GC>   parser.get_document()
GC>   parser.get_document()->get_root_node()
GC> can be NULL,

 I don't think the first pointer can be NULL (parse_file() would have
thrown) but in the second one it does indeed seem to be possible. And this
is indeed pretty bad. But maybe this can be mitigated by submitting patches
to libxml++ throwing an exception instead of returning NULL pointers?

 In any case, I still think libxml++ has more chances of being developed
[again] than xmlwrapp. This advantage is not nearly big enough to make me
argue for switching from xmlwrapp to libxml++ but seeing that we've already
done the switch, I think we should stick to it.

 Regards,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]