[xml] _private in xmlNs?



Hello Daniel,

is it possible to add _private to xmlNs too ?
This would greatly help in implementing DOM wrapper for namespace
declaration nodes; otherwise I have to keep a map of xmlNs node and its
wrapper object.

I suggest doing it by the following patch - "_private" is made the first
member, and "next" is moved to the end of the struct, so that the layout is
as similar as possible to structure of other nodes:

Index: tree.h
===================================================================
RCS file: /cvs/gnome/gnome-xml/include/libxml/tree.h,v
retrieving revision 1.110
diff -u -3 -r1.110 tree.h
--- tree.h      10 Jun 2002 15:59:41 -0000      1.110
+++ tree.h      14 Jun 2002 13:23:30 -0000
@@ -309,10 +309,11 @@
 typedef struct _xmlNs xmlNs;
 typedef xmlNs *xmlNsPtr;
 struct _xmlNs {
-    struct _xmlNs  *next;      /* next Ns link for this node  */
+    void           *_private;  /* application data */
     xmlNsType      type;       /* global or local */
     const xmlChar *href;       /* URL for the namespace */
     const xmlChar *prefix;     /* prefix for the namespace */
+    struct _xmlNs  *next;      /* next Ns link for this node  */
 };

 /**

Regards,
Petr





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