Re: [libxml++] wrapper for the xmlreader interface



On Wed, 2003-02-12 at 00:46, Edd Dumbill wrote:

> The biggest trouble so far is that the underlying XmlTextReader stuff
> handles allocation and freeing of things differently than the normal
> parsers.  This means that the construct() and destruct() functions just
> don't work. 

Could you give us more specifics about the problem, mentioning classes,
C structs, an example etc?

>  I disabled them entirely for the purposes of this wrapper,
> but it needs figuring out properly -- a bit beyond the scope of one
> evening's hacking for me, unfamiliar as I am with the magic of libxmlpp
> internals.  However, this disabling meant I couldn't implement the two
> methods which allow sniffing of the current Node and Document. 



> The other thing to note is that every time you get an xmlChar* back from
> a method, it's your responsibility to free it with xmlFree().

Please use std::string instead.

> I hope that this is a good enough start for someone with more clues than
> I to improve.  Alternatively, I'd be happy to receive a few pointers
> from folk on how best to make the wrapper more C++ idiomatic,

Please
- use std::string rather than XmlChar*.
- use e.g. get_name() rather than name(), etc.
as we have in the rest of libxml++.

>  and in
> particular solve the construct/destruct issues.
> 
> The *good news* is that this stuff works for parsing namespace-enabled
> XML documents.

Wonderful. Well done so far.

-- 
Murray Cumming
murray usa net
www.murrayc.com





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