apply patch from Marcus Meissner to add gcc attribute alloc_size should

* include/libxml/xmlversion.h.in include/libxml/xmlmemory.h:
  apply patch from Marcus Meissner to add gcc attribute alloc_size
  should fix #552505
* doc/apibuild.py doc/* testapi.c: regenerate the API
* include/libxml/parserInternals.h: fix a comment problem raised
  by apibuild.py
daniel

svn path=/trunk/; revision=3811
diff --git a/ChangeLog b/ChangeLog
index 334d848..889b361 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sun Jan 18 18:22:33 CET 2009 Daniel Veillard <daniel@veillard.com>
+
+	* include/libxml/xmlversion.h.in include/libxml/xmlmemory.h:
+	  apply patch from Marcus Meissner to add gcc attribute alloc_size
+	  should fix #552505
+	* doc/apibuild.py doc/* testapi.c: regenerate the API
+	* include/libxml/parserInternals.h: fix a comment problem raised
+	  by apibuild.py
+
 Sun Jan 18 16:39:01 CET 2009 Daniel Veillard <daniel@veillard.com>
 
 	* threads.c: also remove pthread key when stopping thread
diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html
index aeb315a..e8f243f 100644
--- a/doc/APIchunk2.html
+++ b/doc/APIchunk2.html
@@ -199,11 +199,13 @@
 </dd></dl><h2>Letter E:</h2><dl><dt>ELEMENT</dt><dd><a href="html/libxml-tree.html#_xmlElementContent">_xmlElementContent</a><br />
 </dd><dt>EMPTY</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a><br />
 </dd><dt>ENTITIES</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateDtdFinal">xmlValidateDtdFinal</a><br />
 </dd><dt>ENTITY</dt><dd><a href="html/libxml-HTMLparser.html#htmlParseEntityRef">htmlParseEntityRef</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseEntityValue">xmlParseEntityValue</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateDtdFinal">xmlValidateDtdFinal</a><br />
 </dd><dt>ENTITY_REF</dt><dd><a href="html/libxml-tree.html#xmlNodeBufGetContent">xmlNodeBufGetContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeGetContent">xmlNodeGetContent</a><br />
@@ -294,6 +296,7 @@
 <a href="html/libxml-parserInternals.html#xmlParsePEReference">xmlParsePEReference</a><br />
 <a href="html/libxml-parserInternals.html#xmlParserHandlePEReference">xmlParserHandlePEReference</a><br />
 <a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateOneAttribute">xmlValidateOneAttribute</a><br />
 <a href="html/libxml-valid.html#xmlValidateOneNamespace">xmlValidateOneNamespace</a><br />
 </dd><dt>EntityDecl</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityDecl">xmlParseEntityDecl</a><br />
diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html
index 6e3c9c4..6ac6027 100644
--- a/doc/APIchunk22.html
+++ b/doc/APIchunk22.html
@@ -430,32 +430,6 @@
 </dd><dt>produced</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
 <a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
 </dd><dt>producing</dt><dd><a href="html/libxml-xmlstring.html#xmlCheckUTF8">xmlCheckUTF8</a><br />
-</dd><dt>production</dt><dd><a href="html/libxml-parserInternals.html#IS_BASECHAR">IS_BASECHAR</a><br />
-<a href="html/libxml-parserInternals.html#IS_BLANK">IS_BLANK</a><br />
-<a href="html/libxml-parserInternals.html#IS_BYTE_CHAR">IS_BYTE_CHAR</a><br />
-<a href="html/libxml-parserInternals.html#IS_CHAR">IS_CHAR</a><br />
-<a href="html/libxml-parserInternals.html#IS_COMBINING">IS_COMBINING</a><br />
-<a href="html/libxml-parserInternals.html#IS_DIGIT">IS_DIGIT</a><br />
-<a href="html/libxml-parserInternals.html#IS_EXTENDER">IS_EXTENDER</a><br />
-<a href="html/libxml-parserInternals.html#IS_IDEOGRAPHIC">IS_IDEOGRAPHIC</a><br />
-<a href="html/libxml-parserInternals.html#IS_LETTER">IS_LETTER</a><br />
-<a href="html/libxml-parserInternals.html#IS_PUBIDCHAR">IS_PUBIDCHAR</a><br />
-<a href="html/libxml-parserInternals.html#xmlIsLetter">xmlIsLetter</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
-<a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
-<a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseCharRef">xmlParseCharRef</a><br />
-<a href="html/libxml-parser.html#xmlParseCtxtExternalEntity">xmlParseCtxtExternalEntity</a><br />
-<a href="html/libxml-parser.html#xmlParseExtParsedEnt">xmlParseExtParsedEnt</a><br />
-<a href="html/libxml-parser.html#xmlParseExternalEntity">xmlParseExternalEntity</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
-<a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
-<a href="html/libxml-valid.html#xmlValidateNameValue">xmlValidateNameValue</a><br />
-<a href="html/libxml-valid.html#xmlValidateNamesValue">xmlValidateNamesValue</a><br />
-<a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
-<a href="html/libxml-valid.html#xmlValidateNmtokensValue">xmlValidateNmtokensValue</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPathIdFunction">xmlXPathIdFunction</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPathNormalizeFunction">xmlXPathNormalizeFunction</a><br />
 </dd><dt>production:</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
 </dd><dt>productions</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
 </dd><dt>program</dt><dd><a href="html/libxml-xpointer.html#xmlXPtrNewContext">xmlXPtrNewContext</a><br />
@@ -482,6 +456,7 @@
 <a href="html/libxml-xpath.html#xmlXPathIsNaN">xmlXPathIsNaN</a><br />
 </dd><dt>prolog</dt><dd><a href="html/libxml-parser.html#xmlParseDocument">xmlParseDocument</a><br />
 </dd><dt>prompt</dt><dd><a href="html/libxml-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a><br />
+</dd><dt>proper</dt><dd><a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 </dd><dt>properly</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseMarkupDecl">xmlParseMarkupDecl</a><br />
 <a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html
index 958aefe..6c2be3b 100644
--- a/doc/APIchunk3.html
+++ b/doc/APIchunk3.html
@@ -197,12 +197,14 @@
 <a href="html/libxml-xmlIO.html#xmlParserInputBufferRead">xmlParserInputBufferRead</a><br />
 </dd><dt>IDREF</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
 <a href="html/libxml-valid.html#xmlValidateAttributeDecl">xmlValidateAttributeDecl</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a><br />
 <a href="html/libxml-valid.html#xmlValidateDtd">xmlValidateDtd</a><br />
 <a href="html/libxml-valid.html#xmlValidateOneAttribute">xmlValidateOneAttribute</a><br />
 <a href="html/libxml-valid.html#xmlValidateOneElement">xmlValidateOneElement</a><br />
 <a href="html/libxml-valid.html#xmlValidateOneNamespace">xmlValidateOneNamespace</a><br />
 </dd><dt>IDREFS</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a><br />
 </dd><dt>IDREFs</dt><dd><a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br />
 </dd><dt>IDs</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathIdFunction">xmlXPathIdFunction</a><br />
diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html
index 924c236..b954f38 100644
--- a/doc/APIchunk4.html
+++ b/doc/APIchunk4.html
@@ -182,7 +182,9 @@
 </dd><dt>NDataDecl</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityDecl">xmlParseEntityDecl</a><br />
 </dd><dt>NDataDecl?</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityDecl">xmlParseEntityDecl</a><br />
 </dd><dt>NMTOKEN</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 </dd><dt>NMTOKENS</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 </dd><dt>NMToken</dt><dd><a href="html/libxml-tree.html#xmlValidateNMToken">xmlValidateNMToken</a><br />
 </dd><dt>NOTATION</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEnumeratedType">xmlParseEnumeratedType</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseNotationType">xmlParseNotationType</a><br />
@@ -232,6 +234,7 @@
 </dd><dt>Names</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseName">xmlParseName</a><br />
 <a href="html/libxml-parserInternals.html#xmlScanName">xmlScanName</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNamesValue">xmlValidateNamesValue</a><br />
 </dd><dt>Namespace</dt><dd><a href="html/libxml-tree.html#XML_XML_NAMESPACE">XML_XML_NAMESPACE</a><br />
 <a href="html/libxml-tree.html#_xmlElementContent">_xmlElementContent</a><br />
@@ -248,9 +251,11 @@
 </dd><dt>Nmtoken</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseEnumerationType">xmlParseEnumerationType</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseNmtoken">xmlParseNmtoken</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
 </dd><dt>Nmtokens</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseNmtoken">xmlParseNmtoken</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNmtokensValue">xmlValidateNmtokensValue</a><br />
 </dd><dt>Node</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
 <a href="html/libxml-valid.html#_xmlValidCtxt">_xmlValidCtxt</a><br />
diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html
index 10e852a..2d73300 100644
--- a/doc/APIchunk8.html
+++ b/doc/APIchunk8.html
@@ -119,6 +119,7 @@
 </dd><dt>Thus:</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
 </dd><dt>Tibetan</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsTibetan">xmlUCSIsTibetan</a><br />
 </dd><dt>Token</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNmtokensValue">xmlValidateNmtokensValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateOneAttribute">xmlValidateOneAttribute</a><br />
diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html
index ca0b6eb..e1f38c0 100644
--- a/doc/APIchunk9.html
+++ b/doc/APIchunk9.html
@@ -46,6 +46,7 @@
 <a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
 <a href="html/libxml-schematron.html#xmlSchematronValidateDoc">xmlSchematronValidateDoc</a><br />
 <a href="html/libxml-debugXML.html#xmlShellValidate">xmlShellValidate</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNameValue">xmlValidateNameValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNamesValue">xmlValidateNamesValue</a><br />
 <a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
@@ -62,6 +63,7 @@
 <a href="html/libxml-parserInternals.html#xmlParseDefaultDecl">xmlParseDefaultDecl</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseEnumerationType">xmlParseEnumerationType</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseNotationType">xmlParseNotationType</a><br />
+<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
 </dd><dt>Variable</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathVariableLookup">xmlXPathVariableLookup</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathVariableLookupNS">xmlXPathVariableLookupNS</a><br />
 </dd><dt>VariationSelectors</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsVariationSelectors">xmlUCSIsVariationSelectors</a><br />
diff --git a/doc/APIfiles.html b/doc/APIfiles.html
index 0c9934d..8ad2673 100644
--- a/doc/APIfiles.html
+++ b/doc/APIfiles.html
@@ -614,6 +614,7 @@
 <a href="html/libxml-parser.html#XML_PARSE_NOXINCNODE">XML_PARSE_NOXINCNODE</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_NSCLEAN">XML_PARSE_NSCLEAN</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_OLD10">XML_PARSE_OLD10</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_OLDSAX">XML_PARSE_OLDSAX</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_PEDANTIC">XML_PARSE_PEDANTIC</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_PUSH_DOM">XML_PARSE_PUSH_DOM</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_PUSH_SAX">XML_PARSE_PUSH_SAX</a><br />
@@ -800,6 +801,7 @@
 <a href="html/libxml-parserInternals.html#MOVETO_STARTTAG">MOVETO_STARTTAG</a><br />
 <a href="html/libxml-parserInternals.html#SKIP_EOL">SKIP_EOL</a><br />
 <a href="html/libxml-parserInternals.html#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a><br />
+<a href="html/libxml-parserInternals.html#XML_MAX_TEXT_LENGHT">XML_MAX_TEXT_LENGHT</a><br />
 <a href="html/libxml-parserInternals.html#XML_SUBSTITUTE_BOTH">XML_SUBSTITUTE_BOTH</a><br />
 <a href="html/libxml-parserInternals.html#XML_SUBSTITUTE_NONE">XML_SUBSTITUTE_NONE</a><br />
 <a href="html/libxml-parserInternals.html#XML_SUBSTITUTE_PEREF">XML_SUBSTITUTE_PEREF</a><br />
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html
index 32bfe39..4ed9387 100644
--- a/doc/APIsymbols.html
+++ b/doc/APIsymbols.html
@@ -534,6 +534,7 @@
 <a href="html/libxml-xmlerror.html#XML_IO_WRITE">XML_IO_WRITE</a><br />
 <a href="html/libxml-tree.html#XML_LOCAL_NAMESPACE">XML_LOCAL_NAMESPACE</a><br />
 <a href="html/libxml-parserInternals.html#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a><br />
+<a href="html/libxml-parserInternals.html#XML_MAX_TEXT_LENGHT">XML_MAX_TEXT_LENGHT</a><br />
 <a href="html/libxml-xmlerror.html#XML_MODULE_CLOSE">XML_MODULE_CLOSE</a><br />
 <a href="html/libxml-xmlmodule.html#XML_MODULE_LAZY">XML_MODULE_LAZY</a><br />
 <a href="html/libxml-xmlmodule.html#XML_MODULE_LOCAL">XML_MODULE_LOCAL</a><br />
@@ -589,6 +590,7 @@
 <a href="html/libxml-parser.html#XML_PARSE_NOXINCNODE">XML_PARSE_NOXINCNODE</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_NSCLEAN">XML_PARSE_NSCLEAN</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_OLD10">XML_PARSE_OLD10</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_OLDSAX">XML_PARSE_OLDSAX</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_PEDANTIC">XML_PARSE_PEDANTIC</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_PUSH_DOM">XML_PARSE_PUSH_DOM</a><br />
 <a href="html/libxml-parser.html#XML_PARSE_PUSH_SAX">XML_PARSE_PUSH_SAX</a><br />
diff --git a/doc/apibuild.py b/doc/apibuild.py
index 3c38061..36870da 100755
--- a/doc/apibuild.py
+++ b/doc/apibuild.py
@@ -72,6 +72,7 @@
   "ATTRIBUTE_UNUSED": (0, "macro keyword"),
   "LIBEXSLT_PUBLIC": (0, "macro keyword"),
   "X_IN_Y": (5, "macro function builder"),
+  "ATTRIBUTE_ALLOC_SIZE": (3, "macro for gcc chaking extension"),
 }
 
 def escape(raw):
diff --git a/doc/devhelp/libxml2-parser.html b/doc/devhelp/libxml2-parser.html
index ea0697f..06e863a 100644
--- a/doc/devhelp/libxml2-parser.html
+++ b/doc/devhelp/libxml2-parser.html
@@ -305,7 +305,8 @@
     <a name="XML_PARSE_COMPACT">XML_PARSE_COMPACT</a> = 65536 /* compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree) */
     <a name="XML_PARSE_OLD10">XML_PARSE_OLD10</a> = 131072 /* parse using XML-1.0 before update 5 */
     <a name="XML_PARSE_NOBASEFIX">XML_PARSE_NOBASEFIX</a> = 262144 /* do not fixup XINCLUDE xml:base uris */
-    <a name="XML_PARSE_HUGE">XML_PARSE_HUGE</a> = 524288 /*  relax any hardcoded limit from the parser */
+    <a name="XML_PARSE_HUGE">XML_PARSE_HUGE</a> = 524288 /* relax any hardcoded limit from the parser */
+    <a name="XML_PARSE_OLDSAX">XML_PARSE_OLDSAX</a> = 1048576 /*  parse using SAX2 interface from before 2.7.0 */
 };
 </pre><p/>
 </div>
diff --git a/doc/devhelp/libxml2-parserInternals.html b/doc/devhelp/libxml2-parserInternals.html
index cdae32e..4b9bb0d 100644
--- a/doc/devhelp/libxml2-parserInternals.html
+++ b/doc/devhelp/libxml2-parserInternals.html
@@ -55,6 +55,7 @@
 #define <a href="#IS_LETTER">IS_LETTER</a>(c);
 #define <a href="#IS_IDEOGRAPHIC">IS_IDEOGRAPHIC</a>(c);
 #define <a href="#MOVETO_STARTTAG">MOVETO_STARTTAG</a>(p);
+#define <a href="#XML_MAX_TEXT_LENGHT">XML_MAX_TEXT_LENGHT</a>;
 #define <a href="#IS_ASCII_LETTER">IS_ASCII_LETTER</a>(c);
 #define <a href="#IS_DIGIT">IS_DIGIT</a>(c);
 #define <a href="#XML_SUBSTITUTE_PEREF">XML_SUBSTITUTE_PEREF</a>;
@@ -266,6 +267,10 @@
 </pre><p>Identifiers can be longer, but this will be more costly at runtime.</p>
 </div>
         <hr/>
+        <div class="refsect2" lang="en"><h3><a name="XML_MAX_TEXT_LENGHT">Macro </a>XML_MAX_TEXT_LENGHT</h3><pre class="programlisting">#define <a href="#XML_MAX_TEXT_LENGHT">XML_MAX_TEXT_LENGHT</a>;
+</pre><p/>
+</div>
+        <hr/>
         <div class="refsect2" lang="en"><h3><a name="XML_SUBSTITUTE_BOTH">Macro </a>XML_SUBSTITUTE_BOTH</h3><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_BOTH">XML_SUBSTITUTE_BOTH</a>;
 </pre><p>Both general and parameter entities need to be substituted.</p>
 </div>
diff --git a/doc/devhelp/libxml2-valid.html b/doc/devhelp/libxml2-valid.html
index 15b3371..3480214 100644
--- a/doc/devhelp/libxml2-valid.html
+++ b/doc/devhelp/libxml2-valid.html
@@ -443,8 +443,8 @@
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a document instance</td></tr><tr><td><span class="term"><i><tt>attr</tt></i>:</span></td><td>an <a href="libxml2-SAX.html#attribute">attribute</a> definition</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlValidateAttributeValue"/>xmlValidateAttributeValue ()</h3><pre class="programlisting">int	xmlValidateAttributeValue	(<a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a> type, <br/>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Validate that the given <a href="libxml2-SAX.html#attribute">attribute</a> value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>an <a href="libxml2-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>an <a href="libxml2-SAX.html#attribute">attribute</a> value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlValidateDocument"/>xmlValidateDocument ()</h3><pre class="programlisting">int	xmlValidateDocument		(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br/>
 </pre><p>Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</p>
diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp
index 65bcbda..68cd0a0 100644
--- a/doc/devhelp/libxml2.devhelp
+++ b/doc/devhelp/libxml2.devhelp
@@ -159,6 +159,7 @@
     <function name="XML_GET_LINE" link="libxml2-tree.html#XML_GET_LINE"/>
     <function name="XML_LOCAL_NAMESPACE" link="libxml2-tree.html#XML_LOCAL_NAMESPACE"/>
     <function name="XML_MAX_NAMELEN" link="libxml2-parserInternals.html#XML_MAX_NAMELEN"/>
+    <function name="XML_MAX_TEXT_LENGHT" link="libxml2-parserInternals.html#XML_MAX_TEXT_LENGHT"/>
     <function name="XML_SAX2_MAGIC" link="libxml2-parser.html#XML_SAX2_MAGIC"/>
     <function name="XML_SCHEMAS_ANYATTR_LAX" link="libxml2-schemasInternals.html#XML_SCHEMAS_ANYATTR_LAX"/>
     <function name="XML_SCHEMAS_ANYATTR_SKIP" link="libxml2-schemasInternals.html#XML_SCHEMAS_ANYATTR_SKIP"/>
@@ -770,6 +771,7 @@
     <function name="XML_PARSE_NOXINCNODE" link="libxml2-parser.html#XML_PARSE_NOXINCNODE"/>
     <function name="XML_PARSE_NSCLEAN" link="libxml2-parser.html#XML_PARSE_NSCLEAN"/>
     <function name="XML_PARSE_OLD10" link="libxml2-parser.html#XML_PARSE_OLD10"/>
+    <function name="XML_PARSE_OLDSAX" link="libxml2-parser.html#XML_PARSE_OLDSAX"/>
     <function name="XML_PARSE_PEDANTIC" link="libxml2-parser.html#XML_PARSE_PEDANTIC"/>
     <function name="XML_PARSE_PUSH_DOM" link="libxml2-parser.html#XML_PARSE_PUSH_DOM"/>
     <function name="XML_PARSE_PUSH_SAX" link="libxml2-parser.html#XML_PARSE_PUSH_SAX"/>
diff --git a/doc/html/libxml-parser.html b/doc/html/libxml-parser.html
index 82dbf95..83db4d9 100644
--- a/doc/html/libxml-parser.html
+++ b/doc/html/libxml-parser.html
@@ -285,6 +285,7 @@
     <a name="XML_PARSE_OLD10" id="XML_PARSE_OLD10">XML_PARSE_OLD10</a> = 131072 : parse using XML-1.0 before update 5
     <a name="XML_PARSE_NOBASEFIX" id="XML_PARSE_NOBASEFIX">XML_PARSE_NOBASEFIX</a> = 262144 : do not fixup XINCLUDE xml:base uris
     <a name="XML_PARSE_HUGE" id="XML_PARSE_HUGE">XML_PARSE_HUGE</a> = 524288 : relax any hardcoded limit from the parser
+    <a name="XML_PARSE_OLDSAX" id="XML_PARSE_OLDSAX">XML_PARSE_OLDSAX</a> = 1048576 : parse using SAX2 interface from before 2.7.0
 }
 </pre><h3><a name="xmlSAXHandlerV1" id="xmlSAXHandlerV1">Structure xmlSAXHandlerV1</a></h3><pre class="programlisting">Structure xmlSAXHandlerV1<br />struct _xmlSAXHandlerV1 {
     <a href="libxml-parser.html#internalSubsetSAXFunc">internalSubsetSAXFunc</a>	internalSubset
diff --git a/doc/html/libxml-parserInternals.html b/doc/html/libxml-parserInternals.html
index ad1fb8e..2231ff4 100644
--- a/doc/html/libxml-parserInternals.html
+++ b/doc/html/libxml-parserInternals.html
@@ -10,7 +10,7 @@
 </style><style type="text/css">
       div.deprecated pre.programlisting {border-style: double;border-color:red}
       pre.programlisting {border-style: double;background: #EECFA1}
-    </style><title>Module parserInternals from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module parserInternals from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://codespeak.net/lxml/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-parser.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-parser.html">parser</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-pattern.html">pattern</a></th><td><a accesskey="n" href="libxml-pattern.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>this module exports a number of internal parsing routines they are not really all intended for applications but can prove useful doing low level processing. </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#INPUT_CHUNK">INPUT_CHUNK</a></pre><pre class="programlisting">#define <a href="#IS_ASCII_DIGIT">IS_ASCII_DIGIT</a></pre><pre class="programlisting">#define <a href="#IS_ASCII_LETTER">IS_ASCII_LETTER</a></pre><pre class="programlisting">#define <a href="#IS_BASECHAR">IS_BASECHAR</a></pre><pre class="programlisting">#define <a href="#IS_BLANK">IS_BLANK</a></pre><pre class="programlisting">#define <a href="#IS_BLANK_CH">IS_BLANK_CH</a></pre><pre class="programlisting">#define <a href="#IS_BYTE_CHAR">IS_BYTE_CHAR</a></pre><pre class="programlisting">#define <a href="#IS_CHAR">IS_CHAR</a></pre><pre class="programlisting">#define <a href="#IS_CHAR_CH">IS_CHAR_CH</a></pre><pre class="programlisting">#define <a href="#IS_COMBINING">IS_COMBINING</a></pre><pre class="programlisting">#define <a href="#IS_COMBINING_CH">IS_COMBINING_CH</a></pre><pre class="programlisting">#define <a href="#IS_DIGIT">IS_DIGIT</a></pre><pre class="programlisting">#define <a href="#IS_DIGIT_CH">IS_DIGIT_CH</a></pre><pre class="programlisting">#define <a href="#IS_EXTENDER">IS_EXTENDER</a></pre><pre class="programlisting">#define <a href="#IS_EXTENDER_CH">IS_EXTENDER_CH</a></pre><pre class="programlisting">#define <a href="#IS_IDEOGRAPHIC">IS_IDEOGRAPHIC</a></pre><pre class="programlisting">#define <a href="#IS_LETTER">IS_LETTER</a></pre><pre class="programlisting">#define <a href="#IS_LETTER_CH">IS_LETTER_CH</a></pre><pre class="programlisting">#define <a href="#IS_PUBIDCHAR">IS_PUBIDCHAR</a></pre><pre class="programlisting">#define <a href="#IS_PUBIDCHAR_CH">IS_PUBIDCHAR_CH</a></pre><pre class="programlisting">#define <a href="#MOVETO_ENDTAG">MOVETO_ENDTAG</a></pre><pre class="programlisting">#define <a href="#MOVETO_STARTTAG">MOVETO_STARTTAG</a></pre><pre class="programlisting">#define <a href="#SKIP_EOL">SKIP_EOL</a></pre><pre class="programlisting">#define <a href="#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_BOTH">XML_SUBSTITUTE_BOTH</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_NONE">XML_SUBSTITUTE_NONE</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_PEREF">XML_SUBSTITUTE_PEREF</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_REF">XML_SUBSTITUTE_REF</a></pre><pre class="programlisting"><a href="libxml-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a>	<a href="#htmlCreateFileParserCtxt">htmlCreateFileParserCtxt</a>	(const char * filename, <br />							 const char * encoding)</pre>
+    </style><title>Module parserInternals from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module parserInternals from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://www.blastwave.org/packages.php/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://codespeak.net/lxml/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-parser.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-parser.html">parser</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-pattern.html">pattern</a></th><td><a accesskey="n" href="libxml-pattern.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>this module exports a number of internal parsing routines they are not really all intended for applications but can prove useful doing low level processing. </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#INPUT_CHUNK">INPUT_CHUNK</a></pre><pre class="programlisting">#define <a href="#IS_ASCII_DIGIT">IS_ASCII_DIGIT</a></pre><pre class="programlisting">#define <a href="#IS_ASCII_LETTER">IS_ASCII_LETTER</a></pre><pre class="programlisting">#define <a href="#IS_BASECHAR">IS_BASECHAR</a></pre><pre class="programlisting">#define <a href="#IS_BLANK">IS_BLANK</a></pre><pre class="programlisting">#define <a href="#IS_BLANK_CH">IS_BLANK_CH</a></pre><pre class="programlisting">#define <a href="#IS_BYTE_CHAR">IS_BYTE_CHAR</a></pre><pre class="programlisting">#define <a href="#IS_CHAR">IS_CHAR</a></pre><pre class="programlisting">#define <a href="#IS_CHAR_CH">IS_CHAR_CH</a></pre><pre class="programlisting">#define <a href="#IS_COMBINING">IS_COMBINING</a></pre><pre class="programlisting">#define <a href="#IS_COMBINING_CH">IS_COMBINING_CH</a></pre><pre class="programlisting">#define <a href="#IS_DIGIT">IS_DIGIT</a></pre><pre class="programlisting">#define <a href="#IS_DIGIT_CH">IS_DIGIT_CH</a></pre><pre class="programlisting">#define <a href="#IS_EXTENDER">IS_EXTENDER</a></pre><pre class="programlisting">#define <a href="#IS_EXTENDER_CH">IS_EXTENDER_CH</a></pre><pre class="programlisting">#define <a href="#IS_IDEOGRAPHIC">IS_IDEOGRAPHIC</a></pre><pre class="programlisting">#define <a href="#IS_LETTER">IS_LETTER</a></pre><pre class="programlisting">#define <a href="#IS_LETTER_CH">IS_LETTER_CH</a></pre><pre class="programlisting">#define <a href="#IS_PUBIDCHAR">IS_PUBIDCHAR</a></pre><pre class="programlisting">#define <a href="#IS_PUBIDCHAR_CH">IS_PUBIDCHAR_CH</a></pre><pre class="programlisting">#define <a href="#MOVETO_ENDTAG">MOVETO_ENDTAG</a></pre><pre class="programlisting">#define <a href="#MOVETO_STARTTAG">MOVETO_STARTTAG</a></pre><pre class="programlisting">#define <a href="#SKIP_EOL">SKIP_EOL</a></pre><pre class="programlisting">#define <a href="#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a></pre><pre class="programlisting">#define <a href="#XML_MAX_TEXT_LENGHT">XML_MAX_TEXT_LENGHT</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_BOTH">XML_SUBSTITUTE_BOTH</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_NONE">XML_SUBSTITUTE_NONE</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_PEREF">XML_SUBSTITUTE_PEREF</a></pre><pre class="programlisting">#define <a href="#XML_SUBSTITUTE_REF">XML_SUBSTITUTE_REF</a></pre><pre class="programlisting"><a href="libxml-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a>	<a href="#htmlCreateFileParserCtxt">htmlCreateFileParserCtxt</a>	(const char * filename, <br />							 const char * encoding)</pre>
 <pre class="programlisting">void	<a href="#htmlInitAutoClose">htmlInitAutoClose</a>		(void)</pre>
 <pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#inputPop">inputPop</a>	(<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)</pre>
 <pre class="programlisting">int	<a href="#inputPush">inputPush</a>			(<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value)</pre>
@@ -128,6 +128,7 @@
 <h3><a name="MOVETO_STARTTAG" id="MOVETO_STARTTAG"></a>Macro: MOVETO_STARTTAG</h3><pre>#define MOVETO_STARTTAG</pre><p>Skips to the next '&lt;' char.</p>
 <h3><a name="SKIP_EOL" id="SKIP_EOL"></a>Macro: SKIP_EOL</h3><pre>#define SKIP_EOL</pre><p>Skips the end of line chars.</p>
 <h3><a name="XML_MAX_NAMELEN" id="XML_MAX_NAMELEN"></a>Macro: XML_MAX_NAMELEN</h3><pre>#define XML_MAX_NAMELEN</pre><p>Identifiers can be longer, but this will be more costly at runtime.</p>
+<h3><a name="XML_MAX_TEXT_LENGHT" id="XML_MAX_TEXT_LENGHT"></a>Macro: XML_MAX_TEXT_LENGHT</h3><pre>#define XML_MAX_TEXT_LENGHT</pre><p></p>
 <h3><a name="XML_SUBSTITUTE_BOTH" id="XML_SUBSTITUTE_BOTH"></a>Macro: XML_SUBSTITUTE_BOTH</h3><pre>#define XML_SUBSTITUTE_BOTH</pre><p>Both general and parameter entities need to be substituted.</p>
 <h3><a name="XML_SUBSTITUTE_NONE" id="XML_SUBSTITUTE_NONE"></a>Macro: XML_SUBSTITUTE_NONE</h3><pre>#define XML_SUBSTITUTE_NONE</pre><p>If no entities need to be substituted.</p>
 <h3><a name="XML_SUBSTITUTE_PEREF" id="XML_SUBSTITUTE_PEREF"></a>Macro: XML_SUBSTITUTE_PEREF</h3><pre>#define XML_SUBSTITUTE_PEREF</pre><p>Whether parameter entities need to be substituted.</p>
diff --git a/doc/html/libxml-valid.html b/doc/html/libxml-valid.html
index eb9f667..30ef3cd 100644
--- a/doc/html/libxml-valid.html
+++ b/doc/html/libxml-valid.html
@@ -241,8 +241,8 @@
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the parent</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> name</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new normalized string if normalization is needed, NULL otherwise the caller must free the returned value.</td></tr></tbody></table></div><h3><a name="xmlValidateAttributeDecl" id="xmlValidateAttributeDecl"></a>Function: xmlValidateAttributeDecl</h3><pre class="programlisting">int	xmlValidateAttributeDecl	(<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />					 <a href="libxml-tree.html#xmlAttributePtr">xmlAttributePtr</a> attr)<br />
 </pre><p>Try to validate a single <a href="libxml-SAX.html#attribute">attribute</a> definition basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Default Legal ] - [ VC: Enumeration ] - [ VC: ID Attribute Default ] The ID/IDREF uniqueness and matching are done separately</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a document instance</td></tr><tr><td><span class="term"><i><tt>attr</tt></i>:</span></td><td>an <a href="libxml-SAX.html#attribute">attribute</a> definition</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlValidateAttributeValue" id="xmlValidateAttributeValue"></a>Function: xmlValidateAttributeValue</h3><pre class="programlisting">int	xmlValidateAttributeValue	(<a href="libxml-tree.html#xmlAttributeType">xmlAttributeType</a> type, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlValidateDocument" id="xmlValidateDocument"></a>Function: xmlValidateDocument</h3><pre class="programlisting">int	xmlValidateDocument		(<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
+</pre><p>Validate that the given <a href="libxml-SAX.html#attribute">attribute</a> value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>an <a href="libxml-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>an <a href="libxml-SAX.html#attribute">attribute</a> value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlValidateDocument" id="xmlValidateDocument"></a>Function: xmlValidateDocument</h3><pre class="programlisting">int	xmlValidateDocument		(<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
 </pre><p>Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a document instance</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlValidateDocumentFinal" id="xmlValidateDocumentFinal"></a>Function: xmlValidateDocumentFinal</h3><pre class="programlisting">int	xmlValidateDocumentFinal	(<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
 </pre><p>Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity</p>
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index a688847..fd559a5 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -679,7 +679,7 @@
      <exports symbol='XML_PARSE_UNKNOWN' type='enum'/>
      <exports symbol='XML_WITH_XPATH' type='enum'/>
      <exports symbol='XML_WITH_HTML' type='enum'/>
-     <exports symbol='XML_WITH_FTP' type='enum'/>
+     <exports symbol='XML_PARSE_OLDSAX' type='enum'/>
      <exports symbol='XML_WITH_WRITER' type='enum'/>
      <exports symbol='XML_WITH_C14N' type='enum'/>
      <exports symbol='XML_PARSE_PUSH_DOM' type='enum'/>
@@ -733,6 +733,7 @@
      <exports symbol='XML_PARSER_START' type='enum'/>
      <exports symbol='XML_WITH_DEBUG_MEM' type='enum'/>
      <exports symbol='XML_PARSE_HUGE' type='enum'/>
+     <exports symbol='XML_WITH_FTP' type='enum'/>
      <exports symbol='XML_PARSER_START_TAG' type='enum'/>
      <exports symbol='XML_PARSER_IGNORE' type='enum'/>
      <exports symbol='XML_PARSER_COMMENT' type='enum'/>
@@ -878,6 +879,7 @@
      <exports symbol='IS_LETTER' type='macro'/>
      <exports symbol='IS_IDEOGRAPHIC' type='macro'/>
      <exports symbol='MOVETO_STARTTAG' type='macro'/>
+     <exports symbol='XML_MAX_TEXT_LENGHT' type='macro'/>
      <exports symbol='IS_ASCII_LETTER' type='macro'/>
      <exports symbol='IS_DIGIT' type='macro'/>
      <exports symbol='XML_SUBSTITUTE_PEREF' type='macro'/>
@@ -4106,6 +4108,8 @@
     <macro name='XML_MAX_NAMELEN' file='parserInternals'>
       <info>Identifiers can be longer, but this will be more costly at runtime.</info>
     </macro>
+    <macro name='XML_MAX_TEXT_LENGHT' file='parserInternals'>
+    </macro>
     <macro name='XML_SAX2_MAGIC' file='parser'>
       <info>Special constant found in SAX2 blocks initialized fields</info>
     </macro>
@@ -5032,7 +5036,7 @@
     <enum name='XML_PARSE_DTDATTR' file='parser' value='8' type='xmlParserOption' info='default DTD attributes'/>
     <enum name='XML_PARSE_DTDLOAD' file='parser' value='4' type='xmlParserOption' info='load the external subset'/>
     <enum name='XML_PARSE_DTDVALID' file='parser' value='16' type='xmlParserOption' info='validate with the DTD'/>
-    <enum name='XML_PARSE_HUGE' file='parser' value='524288' type='xmlParserOption' info=' relax any hardcoded limit from the parser'/>
+    <enum name='XML_PARSE_HUGE' file='parser' value='524288' type='xmlParserOption' info='relax any hardcoded limit from the parser'/>
     <enum name='XML_PARSE_NOBASEFIX' file='parser' value='262144' type='xmlParserOption' info='do not fixup XINCLUDE xml:base uris'/>
     <enum name='XML_PARSE_NOBLANKS' file='parser' value='256' type='xmlParserOption' info='remove blank nodes'/>
     <enum name='XML_PARSE_NOCDATA' file='parser' value='16384' type='xmlParserOption' info='merge CDATA as text nodes'/>
@@ -5044,6 +5048,7 @@
     <enum name='XML_PARSE_NOXINCNODE' file='parser' value='32768' type='xmlParserOption' info='do not generate XINCLUDE START/END nodes'/>
     <enum name='XML_PARSE_NSCLEAN' file='parser' value='8192' type='xmlParserOption' info='remove redundant namespaces declarations'/>
     <enum name='XML_PARSE_OLD10' file='parser' value='131072' type='xmlParserOption' info='parse using XML-1.0 before update 5'/>
+    <enum name='XML_PARSE_OLDSAX' file='parser' value='1048576' type='xmlParserOption' info=' parse using SAX2 interface from before 2.7.0'/>
     <enum name='XML_PARSE_PEDANTIC' file='parser' value='128' type='xmlParserOption' info='pedantic error reporting'/>
     <enum name='XML_PARSE_PUSH_DOM' file='parser' value='3' type='xmlParserMode'/>
     <enum name='XML_PARSE_PUSH_SAX' file='parser' value='4' type='xmlParserMode'/>
@@ -16779,10 +16784,10 @@
     </function>
     <function name='xmlValidateAttributeValue' file='valid' module='valid'>
       <cond>defined(LIBXML_VALID_ENABLED)</cond>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='type' type='xmlAttributeType' info=''/>
-      <arg name='value' type='const xmlChar *' info=''/>
+      <info>Validate that the given attribute value match  the proper production  [ VC: ID ] Values of type ID must match the Name production....  [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ...  [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ...  [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</info>
+      <return type='int' info='1 if valid or 0 otherwise'/>
+      <arg name='type' type='xmlAttributeType' info='an attribute type'/>
+      <arg name='value' type='const xmlChar *' info='an attribute value'/>
     </function>
     <function name='xmlValidateDocument' file='valid' module='valid'>
       <cond>defined(LIBXML_VALID_ENABLED)</cond>
diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml
index 148f426..8f42a39 100644
--- a/doc/libxml2-refs.xml
+++ b/doc/libxml2-refs.xml
@@ -528,6 +528,7 @@
     <reference name='XML_IO_WRITE' href='html/libxml-xmlerror.html#XML_IO_WRITE'/>
     <reference name='XML_LOCAL_NAMESPACE' href='html/libxml-tree.html#XML_LOCAL_NAMESPACE'/>
     <reference name='XML_MAX_NAMELEN' href='html/libxml-parserInternals.html#XML_MAX_NAMELEN'/>
+    <reference name='XML_MAX_TEXT_LENGHT' href='html/libxml-parserInternals.html#XML_MAX_TEXT_LENGHT'/>
     <reference name='XML_MODULE_CLOSE' href='html/libxml-xmlerror.html#XML_MODULE_CLOSE'/>
     <reference name='XML_MODULE_LAZY' href='html/libxml-xmlmodule.html#XML_MODULE_LAZY'/>
     <reference name='XML_MODULE_LOCAL' href='html/libxml-xmlmodule.html#XML_MODULE_LOCAL'/>
@@ -583,6 +584,7 @@
     <reference name='XML_PARSE_NOXINCNODE' href='html/libxml-parser.html#XML_PARSE_NOXINCNODE'/>
     <reference name='XML_PARSE_NSCLEAN' href='html/libxml-parser.html#XML_PARSE_NSCLEAN'/>
     <reference name='XML_PARSE_OLD10' href='html/libxml-parser.html#XML_PARSE_OLD10'/>
+    <reference name='XML_PARSE_OLDSAX' href='html/libxml-parser.html#XML_PARSE_OLDSAX'/>
     <reference name='XML_PARSE_PEDANTIC' href='html/libxml-parser.html#XML_PARSE_PEDANTIC'/>
     <reference name='XML_PARSE_PUSH_DOM' href='html/libxml-parser.html#XML_PARSE_PUSH_DOM'/>
     <reference name='XML_PARSE_PUSH_SAX' href='html/libxml-parser.html#XML_PARSE_PUSH_SAX'/>
@@ -4073,6 +4075,7 @@
       <ref name='XML_IO_WRITE'/>
       <ref name='XML_LOCAL_NAMESPACE'/>
       <ref name='XML_MAX_NAMELEN'/>
+      <ref name='XML_MAX_TEXT_LENGHT'/>
       <ref name='XML_MODULE_CLOSE'/>
       <ref name='XML_MODULE_LAZY'/>
       <ref name='XML_MODULE_LOCAL'/>
@@ -4128,6 +4131,7 @@
       <ref name='XML_PARSE_NOXINCNODE'/>
       <ref name='XML_PARSE_NSCLEAN'/>
       <ref name='XML_PARSE_OLD10'/>
+      <ref name='XML_PARSE_OLDSAX'/>
       <ref name='XML_PARSE_PEDANTIC'/>
       <ref name='XML_PARSE_PUSH_DOM'/>
       <ref name='XML_PARSE_PUSH_SAX'/>
@@ -11217,6 +11221,7 @@
       <ref name='XML_PARSE_NOXINCNODE'/>
       <ref name='XML_PARSE_NSCLEAN'/>
       <ref name='XML_PARSE_OLD10'/>
+      <ref name='XML_PARSE_OLDSAX'/>
       <ref name='XML_PARSE_PEDANTIC'/>
       <ref name='XML_PARSE_PUSH_DOM'/>
       <ref name='XML_PARSE_PUSH_SAX'/>
@@ -11405,6 +11410,7 @@
       <ref name='MOVETO_STARTTAG'/>
       <ref name='SKIP_EOL'/>
       <ref name='XML_MAX_NAMELEN'/>
+      <ref name='XML_MAX_TEXT_LENGHT'/>
       <ref name='XML_SUBSTITUTE_BOTH'/>
       <ref name='XML_SUBSTITUTE_NONE'/>
       <ref name='XML_SUBSTITUTE_PEREF'/>
@@ -15318,6 +15324,7 @@
         </word>
         <word name='ENTITIES'>
           <ref name='xmlParseAttributeType'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateDtdFinal'/>
         </word>
         <word name='ENTITY'>
@@ -15325,6 +15332,7 @@
           <ref name='xmlParseAttributeType'/>
           <ref name='xmlParseEntityRef'/>
           <ref name='xmlParseEntityValue'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateDtdFinal'/>
         </word>
         <word name='ENTITY_REF'>
@@ -15459,6 +15467,7 @@
           <ref name='xmlParsePEReference'/>
           <ref name='xmlParserHandlePEReference'/>
           <ref name='xmlParserHandleReference'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateOneAttribute'/>
           <ref name='xmlValidateOneNamespace'/>
         </word>
@@ -15905,6 +15914,7 @@
         <word name='IDREF'>
           <ref name='xmlParseAttributeType'/>
           <ref name='xmlValidateAttributeDecl'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateDocumentFinal'/>
           <ref name='xmlValidateDtd'/>
           <ref name='xmlValidateOneAttribute'/>
@@ -15913,6 +15923,7 @@
         </word>
         <word name='IDREFS'>
           <ref name='xmlParseAttributeType'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateDocumentFinal'/>
         </word>
         <word name='IDREFs'>
@@ -16417,9 +16428,11 @@
         </word>
         <word name='NMTOKEN'>
           <ref name='xmlParseAttributeType'/>
+          <ref name='xmlValidateAttributeValue'/>
         </word>
         <word name='NMTOKENS'>
           <ref name='xmlParseAttributeType'/>
+          <ref name='xmlValidateAttributeValue'/>
         </word>
         <word name='NMToken'>
           <ref name='xmlValidateNMToken'/>
@@ -16487,6 +16500,7 @@
           <ref name='xmlParseAttributeType'/>
           <ref name='xmlParseName'/>
           <ref name='xmlScanName'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateNamesValue'/>
         </word>
         <word name='Namespace'>
@@ -16515,11 +16529,13 @@
           <ref name='xmlParseAttributeType'/>
           <ref name='xmlParseEnumerationType'/>
           <ref name='xmlParseNmtoken'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateNmtokenValue'/>
         </word>
         <word name='Nmtokens'>
           <ref name='xmlParseAttributeType'/>
           <ref name='xmlParseNmtoken'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateNmtokensValue'/>
         </word>
         <word name='Node'>
@@ -17842,6 +17858,7 @@
         </word>
         <word name='Token'>
           <ref name='xmlParseAttributeType'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateNmtokenValue'/>
           <ref name='xmlValidateNmtokensValue'/>
           <ref name='xmlValidateOneAttribute'/>
@@ -18085,6 +18102,7 @@
           <ref name='xmlSchemaValidateStream'/>
           <ref name='xmlSchematronValidateDoc'/>
           <ref name='xmlShellValidate'/>
+          <ref name='xmlValidateAttributeValue'/>
           <ref name='xmlValidateNameValue'/>
           <ref name='xmlValidateNamesValue'/>
           <ref name='xmlValidateNmtokenValue'/>
@@ -18107,6 +18125,7 @@
           <ref name='xmlParseDefaultDecl'/>
           <ref name='xmlParseEnumerationType'/>
           <ref name='xmlParseNotationType'/>
+          <ref name='xmlValidateAttributeValue'/>
         </word>
         <word name='Variable'>
           <ref name='xmlXPathVariableLookup'/>
@@ -26524,34 +26543,6 @@
         <word name='producing'>
           <ref name='xmlCheckUTF8'/>
         </word>
-        <word name='production'>
-          <ref name='IS_BASECHAR'/>
-          <ref name='IS_BLANK'/>
-          <ref name='IS_BYTE_CHAR'/>
-          <ref name='IS_CHAR'/>
-          <ref name='IS_COMBINING'/>
-          <ref name='IS_DIGIT'/>
-          <ref name='IS_EXTENDER'/>
-          <ref name='IS_IDEOGRAPHIC'/>
-          <ref name='IS_LETTER'/>
-          <ref name='IS_PUBIDCHAR'/>
-          <ref name='xmlIsLetter'/>
-          <ref name='xmlParseAttributeType'/>
-          <ref name='xmlParseBalancedChunkMemory'/>
-          <ref name='xmlParseBalancedChunkMemoryRecover'/>
-          <ref name='xmlParseCharRef'/>
-          <ref name='xmlParseCtxtExternalEntity'/>
-          <ref name='xmlParseExtParsedEnt'/>
-          <ref name='xmlParseExternalEntity'/>
-          <ref name='xmlParseExternalID'/>
-          <ref name='xmlParseInNodeContext'/>
-          <ref name='xmlValidateNameValue'/>
-          <ref name='xmlValidateNamesValue'/>
-          <ref name='xmlValidateNmtokenValue'/>
-          <ref name='xmlValidateNmtokensValue'/>
-          <ref name='xmlXPathIdFunction'/>
-          <ref name='xmlXPathNormalizeFunction'/>
-        </word>
         <word name='production:'>
           <ref name='xmlCheckLanguageID'/>
         </word>
@@ -26598,6 +26589,9 @@
         <word name='prompt'>
           <ref name='xmlShellReadlineFunc'/>
         </word>
+        <word name='proper'>
+          <ref name='xmlValidateAttributeValue'/>
+        </word>
         <word name='properly'>
           <ref name='xmlParseElementChildrenContentDecl'/>
           <ref name='xmlParseMarkupDecl'/>
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index 52113c5..d7184f6 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -31,7 +31,7 @@
 XMLPUBVAR unsigned int xmlParserMaxDepth;
 
 /**
- * XML_MAX_TEXT_LENGHT
+ * XML_MAX_TEXT_LENGHT:
  *
  * Maximum size allowed for a single text node when building a tree.
  * This is not a limitation of the parser but a safety boundary feature,
diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h
index ee8328a..8f3b109 100644
--- a/include/libxml/xmlmemory.h
+++ b/include/libxml/xmlmemory.h
@@ -63,7 +63,7 @@
  *
  * Returns a pointer to the newly allocated block or NULL in case of error.
  */
-typedef void *(XMLCALL *xmlMallocFunc)(size_t size);
+typedef void *(ATTRIBUTE_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size);
 
 /**
  * xmlReallocFunc:
@@ -150,7 +150,7 @@
 XMLPUBFUN void XMLCALL
 	xmlMemoryDump	(void);
 XMLPUBFUN void * XMLCALL
-	xmlMemMalloc	(size_t size);
+	xmlMemMalloc	(size_t size) ATTRIBUTE_ALLOC_SIZE(1);
 XMLPUBFUN void * XMLCALL
 	xmlMemRealloc	(void *ptr,size_t size);
 XMLPUBFUN void XMLCALL
@@ -158,11 +158,11 @@
 XMLPUBFUN char * XMLCALL
 	xmlMemoryStrdup	(const char *str);
 XMLPUBFUN void * XMLCALL
-	xmlMallocLoc	(size_t size, const char *file, int line);
+	xmlMallocLoc	(size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1);
 XMLPUBFUN void * XMLCALL
 	xmlReallocLoc	(void *ptr, size_t size, const char *file, int line);
 XMLPUBFUN void * XMLCALL
-	xmlMallocAtomicLoc (size_t size, const char *file, int line);
+	xmlMallocAtomicLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1);
 XMLPUBFUN char * XMLCALL
 	xmlMemStrdupLoc	(const char *str, const char *file, int line);
 
diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in
index 29cef74..4079295 100644
--- a/include/libxml/xmlversion.h.in
+++ b/include/libxml/xmlversion.h.in
@@ -394,8 +394,18 @@
 #ifndef ATTRIBUTE_UNUSED
 #define ATTRIBUTE_UNUSED __attribute__((unused))
 #endif
+#ifndef ATTRIBUTE_ALLOC_SIZE
+# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
+#  define ATTRIBUTE_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
+# else
+#  define ATTRIBUTE_ALLOC_SIZE(x)
+# endif
+#else
+# define ATTRIBUTE_ALLOC_SIZE(x)
+#endif
 #else
 #define ATTRIBUTE_UNUSED
+#define ATTRIBUTE_ALLOC_SIZE(x)
 #endif
 
 #ifdef __cplusplus
diff --git a/testapi.c b/testapi.c
index 37511d6..7a6ba3a 100644
--- a/testapi.c
+++ b/testapi.c
@@ -26144,9 +26144,9 @@
 #if defined(LIBXML_VALID_ENABLED)
     int mem_base;
     int ret_val;
-    xmlAttributeType type; /*  */
+    xmlAttributeType type; /* an attribute type */
     int n_type;
-    xmlChar * value; /*  */
+    xmlChar * value; /* an attribute value */
     int n_value;
 
     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {