> Further -- my own advice -- wrap everything in your own functions.
> This protects against changes or casting problem and makes the API
> work like you expect. 

Why a layer of abstraction? This issue is mainly about lack of
documentation and safe casting functions. I think it would be better to
improve the libxml2 itself. Here's my current attempt on this:

https://github.com/lamefun/libxml2

Specifically:

https://github.com/lamefun/libxml2/blob/sanity/include/libxml/tree.h#L512

and

https://github.com/lamefun/libxml2/blob/sanity/include/libxml/tree.h#L1334

I'm documenting all the insanity and adding safe cast functions like
xmlDocToNode and xmlNodeToDoc that check node types.

If I'm doing something stupid, please tell me.


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to