- HTMLparser.c: Closed bug #54891
- result/HTML/cf_128.html* test/HTML/cf_128.html: added the test
  to the suite
forgot to commit this one yesterday
- encoding.h hash.c nanoftp.h parser.h tree.h uri.h xlink.h xpointer.c:
  applied a documentation patch from LotR and filled in a few missing
  descriptions
Daniel
diff --git a/ChangeLog b/ChangeLog
index 1f91103..c7cb989 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Sat May 19 15:20:03 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+	* HTMLparser.c: Closed bug #54891
+	* result/HTML/cf_128.html* test/HTML/cf_128.html: added the test
+	  to the suite
+
+Thu May 17 14:15:07 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+	* encoding.h hash.c nanoftp.h parser.h tree.h uri.h xlink.h xpointer.c:
+	  applied a documentation patch from LotR and filled in a few missing
+	  descriptions
+
 Wed May 16 23:02:41 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 	* xpath.c tree.c parser.c: speed optimizations at the parser level
diff --git a/HTMLparser.c b/HTMLparser.c
index 5e79464..d2c1e6c 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -739,7 +739,7 @@
 #endif
         } else if (info->endTag == 3) {
 #ifdef DEBUG
-	    xmlGenericError(xmlGenericErrorContext,"End of tag %s: expecting %s\n", name, ctxt->name);
+	    xmlGenericError(xmlGenericErrorContext,"End of tag %s: expecting %s\n", newtag, ctxt->name);
 #endif
 	    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
 		ctxt->sax->error(ctxt->userData,
@@ -1383,7 +1383,7 @@
 htmlEntityValueLookup(unsigned int value) {
     unsigned int i;
 #ifdef DEBUG
-    int lv = 0;
+    unsigned int lv = 0;
 #endif
 
     for (i = 0;i < (sizeof(html40EntitiesTable)/
@@ -4168,6 +4168,15 @@
 #endif
 		    break;
 		}
+		if (in->cur[1] == '/') {
+		    ctxt->instate = XML_PARSER_END_TAG;
+		    ctxt->checkIndex = 0;
+#ifdef DEBUG_PUSH
+		    xmlGenericError(xmlGenericErrorContext,
+			    "HPP: entering END_TAG\n");
+#endif
+		    break;
+		}
 		if ((!terminate) &&
 		    (htmlParseLookupSequence(ctxt, '>', 0, 0) < 0))
 		    goto done;
diff --git a/encoding.h b/encoding.h
index 555558f..f25d9fd 100644
--- a/encoding.h
+++ b/encoding.h
@@ -32,6 +32,8 @@
 #endif
 
 /**
+ * xmlCharEncoding:
+ *
  * Predefined values for some standard encodings
  * Libxml don't do beforehand translation on UTF8, ISOLatinX
  * It also support UTF16 (LE and BE) by default.
diff --git a/hash.c b/hash.c
index fc6fffe..e061c11 100644
--- a/hash.c
+++ b/hash.c
@@ -626,6 +626,7 @@
 }
 
 /**
+ * xmlHashRemoveEntry:
  * @table: the hash table
  * @name: the name of the userdata
  * @f: the deallocator function for removed item (if any)
@@ -642,6 +643,7 @@
 }
 
 /**
+ * xmlHashRemoveEntry2:
  * @table: the hash table
  * @name: the name of the userdata
  * @name2: a second name of the userdata
@@ -659,6 +661,7 @@
 }
 
 /**
+ * xmlHashRemoveEntry3
  * @table: the hash table
  * @name: the name of the userdata
  * @name2: a second name of the userdata
diff --git a/include/libxml/encoding.h b/include/libxml/encoding.h
index 555558f..f25d9fd 100644
--- a/include/libxml/encoding.h
+++ b/include/libxml/encoding.h
@@ -32,6 +32,8 @@
 #endif
 
 /**
+ * xmlCharEncoding:
+ *
  * Predefined values for some standard encodings
  * Libxml don't do beforehand translation on UTF8, ISOLatinX
  * It also support UTF16 (LE and BE) by default.
diff --git a/include/libxml/nanoftp.h b/include/libxml/nanoftp.h
index 5346528..cf33420 100644
--- a/include/libxml/nanoftp.h
+++ b/include/libxml/nanoftp.h
@@ -42,6 +42,10 @@
 				 int minute);
 /**
  * ftpDataCallback: 
+ * @userData: the user provided context
+ * @data: the data received
+ * @len: its size in bytes
+ *
  * A callback for the xmlNanoFTPGet command
  */
 typedef void (*ftpDataCallback) (void *userData, const char *data, int len);
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 0e91245..a8f0637 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -25,6 +25,8 @@
 #define XML_DEFAULT_VERSION	"1.0"
 
 /**
+ * xmlParserInput:
+ *
  * an xmlParserInput is an input flow for the XML processor.
  * Each entity parsed is associated an xmlParserInput (except the
  * few predefined ones). This is the case both for internal entities
@@ -56,6 +58,8 @@
 };
 
 /**
+ * xmlParserNodeInfo:
+ *
  * the parser can be asked to collect Node informations, i.e. at what
  * place in the file they were detected. 
  * NOTE: This is off by default and not very well tested.
@@ -81,6 +85,8 @@
 };
 
 /**
+ * xmlParserInputState:
+ *
  * The parser is now working also as a state based parser
  * The recursive one use the stagte info for entities processing
  */
@@ -105,6 +111,8 @@
 } xmlParserInputState;
 
 /**
+ * xmlParserCtxt:
+ *
  * The parser context.
  * NOTE This doesn't completely defines the parser state, the (current ?)
  *      design of the parser uses recursive function calls since this allow
@@ -191,6 +199,8 @@
 };
 
 /**
+ * xmlSAXLocator:
+ *
  * a SAX Locator.
  */
 typedef struct _xmlSAXLocator xmlSAXLocator;
@@ -203,6 +213,8 @@
 };
 
 /**
+ * xmlSAXHandler:
+ *
  * a SAX handler is bunch of callbacks called by the parser when processing
  * of the input generate data or structure informations.
  */
@@ -288,13 +300,18 @@
 };
 
 /**
+ * xmlExternalEntityLoader:
+ * @URL: The System ID of the resource requested
+ * @ID: The Public ID of the resource requested
+ * @xmlParserCtxtPtr: the XML parser context 
+ *
  * External entity loaders types
  */
 typedef xmlParserInputPtr (*xmlExternalEntityLoader)(const char *URL,
 						     const char *ID,
 						     xmlParserCtxtPtr context);
 
-/**
+/*
  * Global variables: just the default SAX interface tables and XML
  * version infos.
  */
@@ -305,7 +322,7 @@
 LIBXML_DLL_IMPORT extern xmlSAXHandler htmlDefaultSAXHandler;
 LIBXML_DLL_IMPORT extern xmlSAXHandler docbDefaultSAXHandler;
 
-/**
+/*
  * entity substitution default behaviour.
  */
 
@@ -318,13 +335,13 @@
 LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue;
 
 
-/**
+/*
  * Init/Cleanup
  */
 void		xmlInitParser		(void);
 void		xmlCleanupParser	(void);
 
-/**
+/*
  * Input functions
  */
 int		xmlParserInputRead	(xmlParserInputPtr in,
@@ -332,7 +349,7 @@
 int		xmlParserInputGrow	(xmlParserInputPtr in,
 					 int len);
 
-/**
+/*
  * xmlChar handling
  */
 xmlChar *	xmlStrdup		(const xmlChar *cur);
@@ -369,7 +386,7 @@
 					 const xmlChar *add,
 					 int len);
 
-/**
+/*
  * Basic parsing Interfaces
  */
 xmlDocPtr	xmlParseDoc		(xmlChar *cur);
@@ -381,7 +398,7 @@
 void		xmlStopParser		(xmlParserCtxtPtr ctxt);
 int		xmlPedanticParserDefault(int val);
 
-/**
+/*
  * Recovery mode 
  */
 xmlDocPtr	xmlRecoverDoc		(xmlChar *cur);
@@ -389,7 +406,7 @@
 					 int size);
 xmlDocPtr	xmlRecoverFile		(const char *filename);
 
-/**
+/*
  * Less common routines and SAX interfaces
  */
 int		xmlParseDocument	(xmlParserCtxtPtr ctxt);
@@ -440,13 +457,13 @@
 					 const xmlChar *ID,
 					 xmlNodePtr *list);
 
-/**
+/*
  * SAX initialization routines
  */
 void		xmlDefaultSAXHandlerInit(void);
 void		htmlDefaultSAXHandlerInit(void);
 
-/**
+/*
  * Parser contexts handling.
  */
 void		xmlInitParserCtxt	(xmlParserCtxtPtr ctxt);
@@ -457,7 +474,7 @@
 					 const char* filename);
 xmlParserCtxtPtr xmlCreateDocParserCtxt	(xmlChar *cur);
 
-/**
+/*
  * Reading/setting optional parsing features.
  */
 
@@ -470,7 +487,7 @@
 					 const char *name,
 					 void *value);
 
-/**
+/*
  * Interfaces for the Push mode
  */
 xmlParserCtxtPtr xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
@@ -483,7 +500,7 @@
 					 int size,
 					 int terminate);
 
-/**
+/*
  * Special I/O mode
  */
 
@@ -498,7 +515,7 @@
 					 xmlParserInputBufferPtr input,
 					 xmlCharEncoding enc);
 
-/**
+/*
  * Node infos
  */
 const xmlParserNodeInfo*
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 841fef1..4be4c5f 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -313,7 +313,9 @@
     xmlBufferAllocationScheme alloc; /* The realloc method */
 };
 
-/*
+/**
+ * xmlNode:
+ *
  * A node in an XML tree.
  */
 typedef struct _xmlNode xmlNode;
diff --git a/include/libxml/uri.h b/include/libxml/uri.h
index e7aeda4..3d87e14 100644
--- a/include/libxml/uri.h
+++ b/include/libxml/uri.h
@@ -18,20 +18,23 @@
 #endif
 
 /**
+ * xmlURI:
  *
+ * A parsed URI reference. This is a struct containing the various fields
+ * as described in RFC 2396 but separated for further processing
  */
 typedef struct _xmlURI xmlURI;
 typedef xmlURI *xmlURIPtr;
 struct _xmlURI {
-    char *scheme;
-    char *opaque;
-    char *authority;
-    char *server;
-    char *user;
-    int port;
-    char *path;
-    char *query;
-    char *fragment;
+    char *scheme;	/* the URI scheme */
+    char *opaque;	/* opaque part */
+    char *authority;	/* the authority part */
+    char *server;	/* the server part */
+    char *user;		/* the user part */
+    int port;		/* the port number */
+    char *path;		/* the path string */
+    char *query;	/* the query string */
+    char *fragment;	/* the fragment identifier */
 };
 
 /*
diff --git a/include/libxml/xlink.h b/include/libxml/xlink.h
index 37a5415..dbe228b 100644
--- a/include/libxml/xlink.h
+++ b/include/libxml/xlink.h
@@ -156,7 +156,7 @@
     xlinkExtendedLinkSetFunk set;
 };
 
-/**
+/*
  * the default detection routine, can be overriden, they call the default
  * detection callbacks. 
  */
@@ -164,7 +164,7 @@
 xlinkNodeDetectFunc	xlinkGetDefaultDetect	(void);
 void			xlinkSetDefaultDetect	(xlinkNodeDetectFunc func);
 
-/**
+/*
  * Routines to set/get the default handlers.
  */
 xlinkHandlerPtr	xlinkGetDefaultHandler	(void);
diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h
index 12538ab..bd82c6d 100644
--- a/include/libxml/xmlmemory.h
+++ b/include/libxml/xmlmemory.h
@@ -11,9 +11,13 @@
 #include <stdio.h>
 #include <libxml/xmlversion.h>
 
-/*
- * DEBUG_MEMORY_LOCATION should be activated only done when debugging 
- * libxml.
+/**
+ * DEBUG_MEMORY:
+ *
+ * should be activated only done when debugging libxml. It replaces the
+ * allocator with a collect and debug shell to the libc allocator.
+ * DEBUG_MEMORY should be activated only when debugging 
+ * libxml i.e. if libxml has been configured with --with-debug-mem too
  */
 /* #define DEBUG_MEMORY_FREED */
 /* #define DEBUG_MEMORY_LOCATION */
@@ -24,15 +28,15 @@
 #endif
 #endif
 
+/**
+ * DEBUG_MEMORY_LOCATION:
+ *
+ * should be activated 
+ * DEBUG_MEMORY_LOCATION should be activated only when debugging 
+ * libxml i.e. if libxml has been configured with --with-debug-mem too
+ */
 #ifdef DEBUG_MEMORY_LOCATION
 #define MEM_LIST /* keep a list of all the allocated memory blocks */
-#define DEBUG_MEMORY_FREED
-#endif
-
-#ifdef DEBUG_MEMORY_FREED
-#define MEM_CLEANUP(p,l) memset((p), -1, (l));
-#else
-#define MEM_CLEANUP(p,l)
 #endif
 
 #ifdef __cplusplus
diff --git a/nanoftp.h b/nanoftp.h
index 5346528..cf33420 100644
--- a/nanoftp.h
+++ b/nanoftp.h
@@ -42,6 +42,10 @@
 				 int minute);
 /**
  * ftpDataCallback: 
+ * @userData: the user provided context
+ * @data: the data received
+ * @len: its size in bytes
+ *
  * A callback for the xmlNanoFTPGet command
  */
 typedef void (*ftpDataCallback) (void *userData, const char *data, int len);
diff --git a/parser.h b/parser.h
index 0e91245..a8f0637 100644
--- a/parser.h
+++ b/parser.h
@@ -25,6 +25,8 @@
 #define XML_DEFAULT_VERSION	"1.0"
 
 /**
+ * xmlParserInput:
+ *
  * an xmlParserInput is an input flow for the XML processor.
  * Each entity parsed is associated an xmlParserInput (except the
  * few predefined ones). This is the case both for internal entities
@@ -56,6 +58,8 @@
 };
 
 /**
+ * xmlParserNodeInfo:
+ *
  * the parser can be asked to collect Node informations, i.e. at what
  * place in the file they were detected. 
  * NOTE: This is off by default and not very well tested.
@@ -81,6 +85,8 @@
 };
 
 /**
+ * xmlParserInputState:
+ *
  * The parser is now working also as a state based parser
  * The recursive one use the stagte info for entities processing
  */
@@ -105,6 +111,8 @@
 } xmlParserInputState;
 
 /**
+ * xmlParserCtxt:
+ *
  * The parser context.
  * NOTE This doesn't completely defines the parser state, the (current ?)
  *      design of the parser uses recursive function calls since this allow
@@ -191,6 +199,8 @@
 };
 
 /**
+ * xmlSAXLocator:
+ *
  * a SAX Locator.
  */
 typedef struct _xmlSAXLocator xmlSAXLocator;
@@ -203,6 +213,8 @@
 };
 
 /**
+ * xmlSAXHandler:
+ *
  * a SAX handler is bunch of callbacks called by the parser when processing
  * of the input generate data or structure informations.
  */
@@ -288,13 +300,18 @@
 };
 
 /**
+ * xmlExternalEntityLoader:
+ * @URL: The System ID of the resource requested
+ * @ID: The Public ID of the resource requested
+ * @xmlParserCtxtPtr: the XML parser context 
+ *
  * External entity loaders types
  */
 typedef xmlParserInputPtr (*xmlExternalEntityLoader)(const char *URL,
 						     const char *ID,
 						     xmlParserCtxtPtr context);
 
-/**
+/*
  * Global variables: just the default SAX interface tables and XML
  * version infos.
  */
@@ -305,7 +322,7 @@
 LIBXML_DLL_IMPORT extern xmlSAXHandler htmlDefaultSAXHandler;
 LIBXML_DLL_IMPORT extern xmlSAXHandler docbDefaultSAXHandler;
 
-/**
+/*
  * entity substitution default behaviour.
  */
 
@@ -318,13 +335,13 @@
 LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue;
 
 
-/**
+/*
  * Init/Cleanup
  */
 void		xmlInitParser		(void);
 void		xmlCleanupParser	(void);
 
-/**
+/*
  * Input functions
  */
 int		xmlParserInputRead	(xmlParserInputPtr in,
@@ -332,7 +349,7 @@
 int		xmlParserInputGrow	(xmlParserInputPtr in,
 					 int len);
 
-/**
+/*
  * xmlChar handling
  */
 xmlChar *	xmlStrdup		(const xmlChar *cur);
@@ -369,7 +386,7 @@
 					 const xmlChar *add,
 					 int len);
 
-/**
+/*
  * Basic parsing Interfaces
  */
 xmlDocPtr	xmlParseDoc		(xmlChar *cur);
@@ -381,7 +398,7 @@
 void		xmlStopParser		(xmlParserCtxtPtr ctxt);
 int		xmlPedanticParserDefault(int val);
 
-/**
+/*
  * Recovery mode 
  */
 xmlDocPtr	xmlRecoverDoc		(xmlChar *cur);
@@ -389,7 +406,7 @@
 					 int size);
 xmlDocPtr	xmlRecoverFile		(const char *filename);
 
-/**
+/*
  * Less common routines and SAX interfaces
  */
 int		xmlParseDocument	(xmlParserCtxtPtr ctxt);
@@ -440,13 +457,13 @@
 					 const xmlChar *ID,
 					 xmlNodePtr *list);
 
-/**
+/*
  * SAX initialization routines
  */
 void		xmlDefaultSAXHandlerInit(void);
 void		htmlDefaultSAXHandlerInit(void);
 
-/**
+/*
  * Parser contexts handling.
  */
 void		xmlInitParserCtxt	(xmlParserCtxtPtr ctxt);
@@ -457,7 +474,7 @@
 					 const char* filename);
 xmlParserCtxtPtr xmlCreateDocParserCtxt	(xmlChar *cur);
 
-/**
+/*
  * Reading/setting optional parsing features.
  */
 
@@ -470,7 +487,7 @@
 					 const char *name,
 					 void *value);
 
-/**
+/*
  * Interfaces for the Push mode
  */
 xmlParserCtxtPtr xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
@@ -483,7 +500,7 @@
 					 int size,
 					 int terminate);
 
-/**
+/*
  * Special I/O mode
  */
 
@@ -498,7 +515,7 @@
 					 xmlParserInputBufferPtr input,
 					 xmlCharEncoding enc);
 
-/**
+/*
  * Node infos
  */
 const xmlParserNodeInfo*
diff --git a/result/HTML/cf_128.html b/result/HTML/cf_128.html
new file mode 100644
index 0000000..9e82e1e
--- /dev/null
+++ b/result/HTML/cf_128.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html>
+<head><title>gnome-xml push mode bug</title></head>
+<body><table border="4"><tr>
+<td bgcolor="white">
+	Foo1
+	<table border="4"><tr><td>Foo2<p>
+<p>
+</td></tr></table>
+</td>
+<td bgcolor="blue">Foo3</td>
+</tr></table></body>
+</html>
diff --git a/result/HTML/cf_128.html.err b/result/HTML/cf_128.html.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/result/HTML/cf_128.html.err
diff --git a/result/HTML/cf_128.html.sax b/result/HTML/cf_128.html.sax
new file mode 100644
index 0000000..8aa82c1
--- /dev/null
+++ b/result/HTML/cf_128.html.sax
@@ -0,0 +1,69 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(HTML, -//W3C//DTD HTML 4.0 Transitional//EN, http://www.w3.org/TR/REC-html40/strict.dtd)
+SAX.startElement(html)
+SAX.ignorableWhitespace(
+, 1)
+SAX.startElement(head)
+SAX.ignorableWhitespace(
+, 1)
+SAX.startElement(title)
+SAX.characters(gnome-xml push mode bug, 23)
+SAX.endElement(title)
+SAX.ignorableWhitespace(
+, 1)
+SAX.endElement(head)
+SAX.ignorableWhitespace(
+, 1)
+SAX.startElement(body)
+SAX.ignorableWhitespace(
+
+, 2)
+SAX.startElement(table, border='4')
+SAX.characters(
+  , 3)
+SAX.startElement(tr)
+SAX.characters(
+    , 5)
+SAX.startElement(td, bgcolor='white')
+SAX.characters(
+	Foo1
+	, 8)
+SAX.startElement(table, border='4')
+SAX.characters(
+	  , 4)
+SAX.startElement(tr)
+SAX.characters(
+	    , 6)
+SAX.startElement(td)
+SAX.characters(Foo2, 4)
+SAX.startElement(p)
+SAX.endElement(p)
+SAX.startElement(p)
+SAX.endElement(p)
+SAX.endElement(td)
+SAX.endElement(tr)
+SAX.endElement(table)
+SAX.characters(
+    , 5)
+SAX.endElement(td)
+SAX.characters(
+    , 5)
+SAX.startElement(td, bgcolor='blue')
+SAX.characters(Foo3, 4)
+SAX.endElement(td)
+SAX.characters(
+   , 4)
+SAX.endElement(tr)
+SAX.characters(
+  , 3)
+SAX.endElement(table)
+SAX.ignorableWhitespace(
+  , 3)
+SAX.endElement(body)
+SAX.ignorableWhitespace(
+, 1)
+SAX.endElement(html)
+SAX.ignorableWhitespace(  
+, 3)
+SAX.endDocument()
diff --git a/test/HTML/cf_128.html b/test/HTML/cf_128.html
new file mode 100644
index 0000000..4cd118c
--- /dev/null
+++ b/test/HTML/cf_128.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html>
+<head>
+<title>gnome-xml push mode bug</title>
+</head>
+<body>
+
+<table border="4">
+  <tr>
+    <td bgcolor="white">
+	Foo1
+	<table border="4">
+	  <tr>
+	    <td>Foo2<p><p></td></tr></table>
+    </td>
+    <td bgcolor="blue">Foo3</td>
+   </tr>
+  </table>
+  </body>
+</html>  
diff --git a/tree.h b/tree.h
index 841fef1..4be4c5f 100644
--- a/tree.h
+++ b/tree.h
@@ -313,7 +313,9 @@
     xmlBufferAllocationScheme alloc; /* The realloc method */
 };
 
-/*
+/**
+ * xmlNode:
+ *
  * A node in an XML tree.
  */
 typedef struct _xmlNode xmlNode;
diff --git a/uri.h b/uri.h
index e7aeda4..3d87e14 100644
--- a/uri.h
+++ b/uri.h
@@ -18,20 +18,23 @@
 #endif
 
 /**
+ * xmlURI:
  *
+ * A parsed URI reference. This is a struct containing the various fields
+ * as described in RFC 2396 but separated for further processing
  */
 typedef struct _xmlURI xmlURI;
 typedef xmlURI *xmlURIPtr;
 struct _xmlURI {
-    char *scheme;
-    char *opaque;
-    char *authority;
-    char *server;
-    char *user;
-    int port;
-    char *path;
-    char *query;
-    char *fragment;
+    char *scheme;	/* the URI scheme */
+    char *opaque;	/* opaque part */
+    char *authority;	/* the authority part */
+    char *server;	/* the server part */
+    char *user;		/* the user part */
+    int port;		/* the port number */
+    char *path;		/* the path string */
+    char *query;	/* the query string */
+    char *fragment;	/* the fragment identifier */
 };
 
 /*
diff --git a/valid.c b/valid.c
index 81df778..a05a83c 100644
--- a/valid.c
+++ b/valid.c
@@ -4577,6 +4577,7 @@
 int
 xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **list,
                          int max) {
+    xmlValidCtxt vctxt;
     int nb_valid_elements = 0;
     const xmlChar *elements[256];
     int nb_elements = 0, i;
@@ -4592,6 +4593,10 @@
     
     xmlElement *element_desc;
 
+    vctxt.userData = NULL;
+    vctxt.error = NULL;
+    vctxt.warning = NULL;
+
     if (prev == NULL && next == NULL)
         return(-1);
 
@@ -4644,7 +4649,7 @@
     
     for (i = 0;i < nb_elements;i++) {
 	test_node->name = elements[i];
-	if (xmlValidateOneElement(NULL, parent->doc, parent)) {
+	if (xmlValidateOneElement(&vctxt, parent->doc, parent)) {
 	    int j;
 
 	    for (j = 0; j < nb_valid_elements;j++)
diff --git a/xlink.h b/xlink.h
index 37a5415..dbe228b 100644
--- a/xlink.h
+++ b/xlink.h
@@ -156,7 +156,7 @@
     xlinkExtendedLinkSetFunk set;
 };
 
-/**
+/*
  * the default detection routine, can be overriden, they call the default
  * detection callbacks. 
  */
@@ -164,7 +164,7 @@
 xlinkNodeDetectFunc	xlinkGetDefaultDetect	(void);
 void			xlinkSetDefaultDetect	(xlinkNodeDetectFunc func);
 
-/**
+/*
  * Routines to set/get the default handlers.
  */
 xlinkHandlerPtr	xlinkGetDefaultHandler	(void);
diff --git a/xmlmemory.h b/xmlmemory.h
index 12538ab..bd82c6d 100644
--- a/xmlmemory.h
+++ b/xmlmemory.h
@@ -11,9 +11,13 @@
 #include <stdio.h>
 #include <libxml/xmlversion.h>
 
-/*
- * DEBUG_MEMORY_LOCATION should be activated only done when debugging 
- * libxml.
+/**
+ * DEBUG_MEMORY:
+ *
+ * should be activated only done when debugging libxml. It replaces the
+ * allocator with a collect and debug shell to the libc allocator.
+ * DEBUG_MEMORY should be activated only when debugging 
+ * libxml i.e. if libxml has been configured with --with-debug-mem too
  */
 /* #define DEBUG_MEMORY_FREED */
 /* #define DEBUG_MEMORY_LOCATION */
@@ -24,15 +28,15 @@
 #endif
 #endif
 
+/**
+ * DEBUG_MEMORY_LOCATION:
+ *
+ * should be activated 
+ * DEBUG_MEMORY_LOCATION should be activated only when debugging 
+ * libxml i.e. if libxml has been configured with --with-debug-mem too
+ */
 #ifdef DEBUG_MEMORY_LOCATION
 #define MEM_LIST /* keep a list of all the allocated memory blocks */
-#define DEBUG_MEMORY_FREED
-#endif
-
-#ifdef DEBUG_MEMORY_FREED
-#define MEM_CLEANUP(p,l) memset((p), -1, (l));
-#else
-#define MEM_CLEANUP(p,l)
 #endif
 
 #ifdef __cplusplus
diff --git a/xpointer.c b/xpointer.c
index cb2d218..91bbebb 100644
--- a/xpointer.c
+++ b/xpointer.c
@@ -11,7 +11,7 @@
 
 #include "libxml.h"
 
-/**
+/*
  * TODO: better handling of error cases, the full expression should
  *       be parsed beforehand instead of a progressive evaluation
  * TODO: Access into entities references are not supported now ...