added xmlByteConsumed() interface updated the benchmark rebuilt the docs

* parserInternals.c xmlIO.c encoding.c include/libxml/parser.h
  include/libxml/xmlIO.h: added xmlByteConsumed() interface
* doc/*: updated the benchmark rebuilt the docs
* python/tests/Makefile.am python/tests/indexes.py: added a
  specific regression test for xmlByteConsumed()
* include/libxml/encoding.h rngparser.c tree.c: small cleanups
Daniel
diff --git a/ChangeLog b/ChangeLog
index 351e1ca..9795295 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
+Wed Feb 11 14:19:31 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+	* parserInternals.c xmlIO.c encoding.c include/libxml/parser.h
+	  include/libxml/xmlIO.h: added xmlByteConsumed() interface
+	* doc/*: updated the benchmark rebuilt the docs
+	* python/tests/Makefile.am python/tests/indexes.py: added a
+	  specific regression test for xmlByteConsumed()
+	* include/libxml/encoding.h rngparser.c tree.c: small cleanups
+
 Wed Feb 11 08:13:58 HKT 2004 William Brack <wbrack@mmm.com.hk
+
 	* tree.c: fixed missing output of internal DTD param entities when
 	  nothing else present in DTD (bug 134052)
 
diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html
index 5e82728..6be55a6 100644
--- a/doc/APIchunk10.html
+++ b/doc/APIchunk10.html
@@ -52,6 +52,7 @@
 <a href="html/libxml-xmlreader.html#xmlTextReaderExpand">xmlTextReaderExpand</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-valid.html#xmlValidateOneElement">xmlValidateOneElement</a><br />
 <a href="html/libxml-xpath.html#xmlXPathEvalPredicate">xmlXPathEvalPredicate</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathEvaluatePredicateResult">xmlXPathEvaluatePredicateResult</a><br />
@@ -515,6 +516,7 @@
 </dd><dt>computation</dt><dd><a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
 </dd><dt>compute</dt><dd><a href="html/libxml-xmlstring.html#xmlUTF8Strlen">xmlUTF8Strlen</a><br />
 </dd><dt>computed</dt><dd><a href="html/libxml-entities.html#_xmlEntity">_xmlEntity</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-xmlschemastypes.html#xmlSchemaValPredefTypeNode">xmlSchemaValPredefTypeNode</a><br />
 <a href="html/libxml-xmlschemastypes.html#xmlSchemaValidatePredefinedType">xmlSchemaValidatePredefinedType</a><br />
 </dd><dt>concat</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathConcatFunction">xmlXPathConcatFunction</a><br />
@@ -576,6 +578,7 @@
 <a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
 </dd><dt>consist</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathNextAncestor">xmlXPathNextAncestor</a><br />
 </dd><dt>constant</dt><dd><a href="html/libxml-parser.html#XML_SAX2_MAGIC">XML_SAX2_MAGIC</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 </dd><dt>constraint</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
 <a href="html/libxml-valid.html#xmlValidateNotationDecl">xmlValidateNotationDecl</a><br />
 </dd><dt>constraints</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
@@ -587,6 +590,7 @@
 </dd><dt>consumed</dt><dd><a href="html/libxml-HTMLparser.html#UTF8ToHtml">UTF8ToHtml</a><br />
 <a href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a><br />
 <a href="html/libxml-parser.html#_xmlParserInput">_xmlParserInput</a><br />
+<a href="html/libxml-xmlIO.html#_xmlParserInputBuffer">_xmlParserInputBuffer</a><br />
 <a href="html/libxml-DOCBparser.html#docbEncodeEntities">docbEncodeEntities</a><br />
 <a href="html/libxml-HTMLparser.html#htmlEncodeEntities">htmlEncodeEntities</a><br />
 <a href="html/libxml-encoding.html#isolat1ToUTF8">isolat1ToUTF8</a><br />
@@ -741,8 +745,11 @@
 <a href="html/libxml-entities.html#xmlGetDtdEntity">xmlGetDtdEntity</a><br />
 <a href="html/libxml-entities.html#xmlGetParameterEntity">xmlGetParameterEntity</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathTranslateFunction">xmlXPathTranslateFunction</a><br />
+</dd><dt>cost</dt><dd><a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 </dd><dt>costly</dt><dd><a href="html/libxml-parserInternals.html#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a><br />
-</dd><dt>could</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderRelaxNGSetSchema">xmlTextReaderRelaxNGSetSchema</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
+</dd><dt>could</dt><dd><a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderRelaxNGSetSchema">xmlTextReaderRelaxNGSetSchema</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderRelaxNGValidate">xmlTextReaderRelaxNGValidate</a><br />
 </dd><dt>count</dt><dd><a href="html/libxml-nanoftp.html#ftpListCallback">ftpListCallback</a><br />
 <a href="html/libxml-debugXML.html#xmlLsCountNode">xmlLsCountNode</a><br />
diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html
index 5ada767..1abf76b 100644
--- a/doc/APIchunk13.html
+++ b/doc/APIchunk13.html
@@ -172,6 +172,7 @@
 <a href="html/libxml-parserInternals.html#xmlSkipBlankChars">xmlSkipBlankChars</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderPreservePattern">xmlTextReaderPreservePattern</a><br />
+</dd><dt>finishing</dt><dd><a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 </dd><dt>firs</dt><dd><a href="html/libxml-encoding.html#xmlCharEncOutFunc">xmlCharEncOutFunc</a><br />
 </dd><dt>fist</dt><dd><a href="html/libxml-parserInternals.html#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a><br />
 </dd><dt>fit</dt><dd><a href="html/libxml-encoding.html#xmlCharEncFirstLine">xmlCharEncFirstLine</a><br />
diff --git a/doc/APIchunk14.html b/doc/APIchunk14.html
index 328f5e8..0f65657 100644
--- a/doc/APIchunk14.html
+++ b/doc/APIchunk14.html
@@ -189,6 +189,7 @@
 <a href="html/libxml-xmlIO.html#xmlRegisterDefaultInputCallbacks">xmlRegisterDefaultInputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 </dd><dt>handles</dt><dd><a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
 <a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
 <a href="html/libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a><br />
diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html
index ea3ebe4..0d906df 100644
--- a/doc/APIchunk15.html
+++ b/doc/APIchunk15.html
@@ -181,6 +181,7 @@
 <a href="html/libxml-parserInternals.html#inputPush">inputPush</a><br />
 <a href="html/libxml-parserInternals.html#namePush">namePush</a><br />
 <a href="html/libxml-parserInternals.html#nodePush">nodePush</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
 <a href="html/libxml-xmlstring.html#xmlStrsub">xmlStrsub</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderGetAttributeNo">xmlTextReaderGetAttributeNo</a><br />
diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html
index ea860b0..5252a66 100644
--- a/doc/APIchunk18.html
+++ b/doc/APIchunk18.html
@@ -167,6 +167,7 @@
 </dd><dt>non-NULL</dt><dd><a href="html/libxml-HTMLparser.html#htmlParseEntityRef">htmlParseEntityRef</a><br />
 <a href="html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseEntityValue">xmlParseEntityValue</a><br />
+</dd><dt>non-UTF-8</dt><dd><a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 </dd><dt>non-blank</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
 </dd><dt>non-determinist</dt><dd><a href="html/libxml-valid.html#_xmlValidCtxt">_xmlValidCtxt</a><br />
 </dd><dt>non-empty</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathBooleanFunction">xmlXPathBooleanFunction</a><br />
diff --git a/doc/APIchunk19.html b/doc/APIchunk19.html
index bc86e59..56f16b3 100644
--- a/doc/APIchunk19.html
+++ b/doc/APIchunk19.html
@@ -73,7 +73,6 @@
 <a href="html/libxml-parserInternals.html#xmlParseSDDecl">xmlParseSDDecl</a><br />
 <a href="html/libxml-xmlstring.html#xmlStrPrintf">xmlStrPrintf</a><br />
 <a href="html/libxml-xmlstring.html#xmlStrVPrintf">xmlStrVPrintf</a><br />
-</dd><dt>ocetes</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
 </dd><dt>octets</dt><dd><a href="html/libxml-HTMLparser.html#UTF8ToHtml">UTF8ToHtml</a><br />
 <a href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a><br />
 <a href="html/libxml-DOCBparser.html#docbEncodeEntities">docbEncodeEntities</a><br />
diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html
index 9dfb9a3..58fad06 100644
--- a/doc/APIchunk20.html
+++ b/doc/APIchunk20.html
@@ -81,6 +81,7 @@
 </dd><dt>pass</dt><dd><a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
 <a href="html/libxml-relaxng.html#xmlRelaxParserSetFlag">xmlRelaxParserSetFlag</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 </dd><dt>passed</dt><dd><a href="html/libxml-xpathInternals.html#CHECK_ARITY">CHECK_ARITY</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewTransition">xmlAutomataNewTransition</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewTransition2">xmlAutomataNewTransition2</a><br />
@@ -372,7 +373,8 @@
 </dd><dt>produce</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
 <a href="html/libxml-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a><br />
 <a href="html/libxml-tree.html#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a><br />
-</dd><dt>produced</dt><dd><a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
+</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#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
 </dd><dt>productions</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
@@ -444,6 +446,7 @@
 <a href="html/libxml-xmlstring.html#xmlUTF8Strpos">xmlUTF8Strpos</a><br />
 </dd><dt>provides</dt><dd><a href="html/libxml-parser.html#endElementNsSAX2Func">endElementNsSAX2Func</a><br />
 <a href="html/libxml-parser.html#startElementNsSAX2Func">startElementNsSAX2Func</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-SAX2.html#xmlSAX2EndElementNs">xmlSAX2EndElementNs</a><br />
 <a href="html/libxml-SAX2.html#xmlSAX2StartElementNs">xmlSAX2StartElementNs</a><br />
 </dd><dt>providing</dt><dd><a href="html/libxml-parserInternals.html#INPUT_CHUNK">INPUT_CHUNK</a><br />
diff --git a/doc/APIchunk21.html b/doc/APIchunk21.html
index ee86483..abbfa1a 100644
--- a/doc/APIchunk21.html
+++ b/doc/APIchunk21.html
@@ -317,7 +317,8 @@
 <a href="html/libxml-valid.html#xmlValidCtxtNormalizeAttributeValue">xmlValidCtxtNormalizeAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
 </dd><dt>relationships</dt><dd><a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br />
-</dd><dt>relative</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderGetAttributeNo">xmlTextReaderGetAttributeNo</a><br />
+</dd><dt>relative</dt><dd><a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderGetAttributeNo">xmlTextReaderGetAttributeNo</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderMoveToAttributeNo">xmlTextReaderMoveToAttributeNo</a><br />
 <a href="html/libxml-xmlstring.html#xmlUTF8Strloc">xmlUTF8Strloc</a><br />
 <a href="html/libxml-xmlstring.html#xmlUTF8Strsub">xmlUTF8Strsub</a><br />
@@ -482,6 +483,7 @@
 </dd><dt>responsible</dt><dd><a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
 <a href="html/libxml-uri.html#xmlCanonicPath">xmlCanonicPath</a><br />
 </dd><dt>restored</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 </dd><dt>restrict</dt><dd><a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
 </dd><dt>results</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathEqualValues">xmlXPathEqualValues</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathNotEqualValues">xmlXPathNotEqualValues</a><br />
@@ -567,6 +569,7 @@
 </dd><dt>rules</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ANYATTR_STRICT">XML_SCHEMAS_ANYATTR_STRICT</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
 </dd><dt>run</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 </dd><dt>running</dt><dd><a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
 </dd><dt>runtime</dt><dd><a href="html/libxml-parserInternals.html#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a><br />
 </dd></dl><h2 align="center"><a href="APIchunk0.html">A-B</a>
diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html
index 3e8d7e7..d0233a9 100644
--- a/doc/APIchunk22.html
+++ b/doc/APIchunk22.html
@@ -280,6 +280,7 @@
 <a href="html/libxml-xpath.html#xmlXPathNodeSetGetLength">xmlXPathNodeSetGetLength</a><br />
 <a href="html/libxml-xpath.html#xmlXPathNodeSetItem">xmlXPathNodeSetItem</a><br />
 </dd><dt>simple</dt><dd><a href="html/libxml-xlink.html#xlinkSimpleLinkFunk">xlinkSimpleLinkFunk</a><br />
+<a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 <a href="html/libxml-threads.html#xmlFreeMutex">xmlFreeMutex</a><br />
 <a href="html/libxml-hash.html#xmlHashScanner">xmlHashScanner</a><br />
 <a href="html/libxml-valid.html#xmlIsRef">xmlIsRef</a><br />
@@ -473,6 +474,7 @@
 <a href="html/libxml-SAX.html#startDocument">startDocument</a><br />
 <a href="html/libxml-parser.html#startDocumentSAXFunc">startDocumentSAXFunc</a><br />
 <a href="html/libxml-parser.html#startElementNsSAX2Func">startElementNsSAX2Func</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br />
 <a href="html/libxml-relaxng.html#xmlRelaxNGValidatePushElement">xmlRelaxNGValidatePushElement</a><br />
 <a href="html/libxml-SAX2.html#xmlSAX2StartDocument">xmlSAX2StartDocument</a><br />
@@ -490,6 +492,7 @@
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewTransition">xmlAutomataNewTransition</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewTransition2">xmlAutomataNewTransition2</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-tree.html#xmlNewCharRef">xmlNewCharRef</a><br />
 <a href="html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a><br />
 <a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
diff --git a/doc/APIchunk24.html b/doc/APIchunk24.html
index b2d1116..ac217c7 100644
--- a/doc/APIchunk24.html
+++ b/doc/APIchunk24.html
@@ -257,10 +257,12 @@
 <a href="html/libxml-xmlschemas.html#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a><br />
 <a href="html/libxml-tree.html#xmlSearchNs">xmlSearchNs</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-valid.html#xmlValidityWarningFunc">xmlValidityWarningFunc</a><br />
 </dd><dt>warnings</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
 <a href="html/libxml-parser.html#xmlPedanticParserDefault">xmlPedanticParserDefault</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 </dd><dt>way</dt><dd><a href="html/libxml-HTMLtree.html#HTML_COMMENT_NODE">HTML_COMMENT_NODE</a><br />
 <a href="html/libxml-HTMLtree.html#HTML_ENTITY_REF_NODE">HTML_ENTITY_REF_NODE</a><br />
 <a href="html/libxml-HTMLtree.html#HTML_PI_NODE">HTML_PI_NODE</a><br />
diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html
index 769d8a9..10203ac 100644
--- a/doc/APIchunk26.html
+++ b/doc/APIchunk26.html
@@ -59,6 +59,7 @@
 <a href="html/libxml-HTMLparser.html#htmlReadDoc">htmlReadDoc</a><br />
 <a href="html/libxml-tree.html#xmlBufferCCat">xmlBufferCCat</a><br />
 <a href="html/libxml-tree.html#xmlBufferCat">xmlBufferCat</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-parser.html#xmlCtxtReadDoc">xmlCtxtReadDoc</a><br />
 <a href="html/libxml-xmlIO.html#xmlOutputBufferWriteString">xmlOutputBufferWriteString</a><br />
 <a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
diff --git a/doc/APIchunk6.html b/doc/APIchunk6.html
index 804196a..1e591d5 100644
--- a/doc/APIchunk6.html
+++ b/doc/APIchunk6.html
@@ -115,6 +115,7 @@
 <a href="html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathRegisterFunc">xmlXPathRegisterFunc</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathRegisterFuncNS">xmlXPathRegisterFuncNS</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a><br />
@@ -318,6 +319,7 @@
 </dd><dt>Seems</dt><dd><a href="html/libxml-parserInternals.html#xmlParseTextDecl">xmlParseTextDecl</a><br />
 </dd><dt>Semi</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxParserSetFlag">xmlRelaxParserSetFlag</a><br />
 </dd><dt>Send</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPQuit">xmlNanoFTPQuit</a><br />
+</dd><dt>Serialize</dt><dd><a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 </dd><dt>Set</dt><dd><a href="html/libxml-HTMLparser.html#htmlHandleOmittedElem">htmlHandleOmittedElem</a><br />
 <a href="html/libxml-xmlerror.html#initGenericErrorDefaultFunc">initGenericErrorDefaultFunc</a><br />
 <a href="html/libxml-SAX.html#setNamespace">setNamespace</a><br />
diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html
index d2993e4..50673e4 100644
--- a/doc/APIchunk8.html
+++ b/doc/APIchunk8.html
@@ -501,6 +501,7 @@
 <a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
 </dd><dt>amd</dt><dd><a href="html/libxml-catalog.html#xmlCatalogIsEmpty">xmlCatalogIsEmpty</a><br />
 </dd><dt>amount</dt><dd><a href="html/libxml-parserInternals.html#INPUT_CHUNK">INPUT_CHUNK</a><br />
+<a href="html/libxml-xmlIO.html#_xmlParserInputBuffer">_xmlParserInputBuffer</a><br />
 <a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
 <a href="html/libxml-xmlIO.html#xmlParserInputBufferGrow">xmlParserInputBufferGrow</a><br />
 <a href="html/libxml-xmlIO.html#xmlParserInputBufferRead">xmlParserInputBufferRead</a><br />
diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html
index a29af07..518c28b 100644
--- a/doc/APIchunk9.html
+++ b/doc/APIchunk9.html
@@ -92,6 +92,7 @@
 <a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
 </dd><dt>beginning</dt><dd><a href="html/libxml-tree.html#xmlBufferAddHead">xmlBufferAddHead</a><br />
 <a href="html/libxml-tree.html#xmlBufferShrink">xmlBufferShrink</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-list.html#xmlListInsert">xmlListInsert</a><br />
 <a href="html/libxml-list.html#xmlListPushFront">xmlListPushFront</a><br />
 <a href="html/libxml-parserInternals.html#xmlStringCurrentChar">xmlStringCurrentChar</a><br />
@@ -234,6 +235,7 @@
 <a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
 <a href="html/libxml-xlink.html#xlinkIsLink">xlinkIsLink</a><br />
 <a href="html/libxml-catalog.html#xmlACatalogAdd">xmlACatalogAdd</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
 <a href="html/libxml-encoding.html#xmlCharEncFirstLine">xmlCharEncFirstLine</a><br />
 <a href="html/libxml-xmlstring.html#xmlCheckUTF8">xmlCheckUTF8</a><br />
@@ -265,6 +267,7 @@
 <a href="html/libxml-HTMLtree.html#htmlSaveFileEnc">htmlSaveFileEnc</a><br />
 <a href="html/libxml-HTMLtree.html#htmlSaveFileFormat">htmlSaveFileFormat</a><br />
 <a href="html/libxml-tree.html#xmlBufferCreateStatic">xmlBufferCreateStatic</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-encoding.html#xmlCharEncFirstLine">xmlCharEncFirstLine</a><br />
 <a href="html/libxml-encoding.html#xmlCharEncInFunc">xmlCharEncInFunc</a><br />
 <a href="html/libxml-encoding.html#xmlCharEncOutFunc">xmlCharEncOutFunc</a><br />
diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html
index e5a8fd2..e0a2109 100644
--- a/doc/APIconstructors.html
+++ b/doc/APIconstructors.html
@@ -77,7 +77,8 @@
 </p><h2>Type htmlStatus:</h2><p><a href="html/libxml-HTMLparser.html#htmlAttrAllowed">htmlAttrAllowed</a><br />
 <a href="html/libxml-HTMLparser.html#htmlElementStatusHere">htmlElementStatusHere</a><br />
 <a href="html/libxml-HTMLparser.html#htmlNodeStatus">htmlNodeStatus</a><br />
-</p><h2>Type long:</h2><p><a href="html/libxml-tree.html#xmlGetLineNo">xmlGetLineNo</a><br />
+</p><h2>Type long:</h2><p><a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
+<a href="html/libxml-tree.html#xmlGetLineNo">xmlGetLineNo</a><br />
 <a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
 </p><h2>Type unsigned long:</h2><p><a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
 </p><h2>Type void *:</h2><p><a href="html/libxml-catalog.html#xmlCatalogAddLocal">xmlCatalogAddLocal</a><br />
diff --git a/doc/APIfiles.html b/doc/APIfiles.html
index 571ea72..c1a4b95 100644
--- a/doc/APIfiles.html
+++ b/doc/APIfiles.html
@@ -637,6 +637,7 @@
 <a href="html/libxml-parser.html#startElementSAXFunc">startElementSAXFunc</a><br />
 <a href="html/libxml-parser.html#unparsedEntityDeclSAXFunc">unparsedEntityDeclSAXFunc</a><br />
 <a href="html/libxml-parser.html#warningSAXFunc">warningSAXFunc</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
 <a href="html/libxml-parser.html#xmlClearNodeInfoSeq">xmlClearNodeInfoSeq</a><br />
 <a href="html/libxml-parser.html#xmlClearParserCtxt">xmlClearParserCtxt</a><br />
@@ -1096,6 +1097,7 @@
 <a href="html/libxml-tree.html#xmlAddSibling">xmlAddSibling</a><br />
 <a href="html/libxml-tree.html#xmlAttr">xmlAttr</a><br />
 <a href="html/libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a><br />
+<a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 <a href="html/libxml-tree.html#xmlAttribute">xmlAttribute</a><br />
 <a href="html/libxml-tree.html#xmlAttributeDefault">xmlAttributeDefault</a><br />
 <a href="html/libxml-tree.html#xmlAttributePtr">xmlAttributePtr</a><br />
@@ -2183,6 +2185,7 @@
 <a href="html/libxml-xmlreader.html#xmlTextReaderRelaxNGValidate">xmlTextReaderRelaxNGValidate</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderValue">xmlTextReaderValue</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderXmlLang">xmlTextReaderXmlLang</a><br />
 </p><h2><a name="xmlregexp" id="xmlregexp">Module xmlregexp</a>:</h2><p><a href="html/libxml-xmlregexp.html#xmlRegExecCallbacks">xmlRegExecCallbacks</a><br />
diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html
index d9bae30..1808031 100644
--- a/doc/APIfunctions.html
+++ b/doc/APIfunctions.html
@@ -176,6 +176,7 @@
 <a href="html/libxml-valid.html#xmlAddID">xmlAddID</a><br />
 <a href="html/libxml-valid.html#xmlAddNotationDecl">xmlAddNotationDecl</a><br />
 <a href="html/libxml-valid.html#xmlAddRef">xmlAddRef</a><br />
+<a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewCountTrans">xmlAutomataNewCountTrans</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewTransition">xmlAutomataNewTransition</a><br />
@@ -809,6 +810,7 @@
 <a href="html/libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-globals.html#xmlThrDefSetGenericErrorFunc">xmlThrDefSetGenericErrorFunc</a><br />
 <a href="html/libxml-globals.html#xmlThrDefSetStructuredErrorFunc">xmlThrDefSetStructuredErrorFunc</a><br />
 <a href="html/libxml-valid.html#xmlValidityErrorFunc">xmlValidityErrorFunc</a><br />
@@ -827,6 +829,7 @@
 </p><h2>Type xlinkShow *:</h2><p><a href="html/libxml-xlink.html#xlinkExtendedLinkFunk">xlinkExtendedLinkFunk</a><br />
 </p><h2>Type xmlAttrPtr:</h2><p><a href="html/libxml-valid.html#xmlAddID">xmlAddID</a><br />
 <a href="html/libxml-valid.html#xmlAddRef">xmlAddRef</a><br />
+<a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 <a href="html/libxml-tree.html#xmlCopyProp">xmlCopyProp</a><br />
 <a href="html/libxml-tree.html#xmlCopyPropList">xmlCopyPropList</a><br />
 <a href="html/libxml-debugXML.html#xmlDebugDumpAttr">xmlDebugDumpAttr</a><br />
@@ -875,6 +878,7 @@
 <a href="html/libxml-tree.html#xmlSetBufferAllocationScheme">xmlSetBufferAllocationScheme</a><br />
 <a href="html/libxml-globals.html#xmlThrDefBufferAllocScheme">xmlThrDefBufferAllocScheme</a><br />
 </p><h2>Type xmlBufferPtr:</h2><p><a href="html/libxml-HTMLtree.html#htmlNodeDump">htmlNodeDump</a><br />
+<a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 <a href="html/libxml-tree.html#xmlBufferAdd">xmlBufferAdd</a><br />
 <a href="html/libxml-tree.html#xmlBufferAddHead">xmlBufferAddHead</a><br />
 <a href="html/libxml-tree.html#xmlBufferCCat">xmlBufferCCat</a><br />
@@ -1022,6 +1026,7 @@
 <a href="html/libxml-entities.html#xmlAddDtdEntity">xmlAddDtdEntity</a><br />
 <a href="html/libxml-valid.html#xmlAddID">xmlAddID</a><br />
 <a href="html/libxml-valid.html#xmlAddRef">xmlAddRef</a><br />
+<a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocSave">xmlC14NDocSave</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocSaveTo">xmlC14NDocSaveTo</a><br />
@@ -1515,6 +1520,7 @@
 <a href="html/libxml-parserInternals.html#namePush">namePush</a><br />
 <a href="html/libxml-parserInternals.html#nodePop">nodePop</a><br />
 <a href="html/libxml-parserInternals.html#nodePush">nodePush</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-xmlIO.html#xmlCheckHTTPInput">xmlCheckHTTPInput</a><br />
 <a href="html/libxml-parser.html#xmlClearParserCtxt">xmlClearParserCtxt</a><br />
 <a href="html/libxml-parser.html#xmlCtxtReadDoc">xmlCtxtReadDoc</a><br />
@@ -1753,6 +1759,7 @@
 </p><h2>Type xmlStrdupFunc *:</h2><p><a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
 <a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
 </p><h2>Type xmlStructuredErrorFunc:</h2><p><a href="html/libxml-xmlerror.html#xmlSetStructuredErrorFunc">xmlSetStructuredErrorFunc</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-globals.html#xmlThrDefSetStructuredErrorFunc">xmlThrDefSetStructuredErrorFunc</a><br />
 </p><h2>Type xmlTextReaderErrorFunc:</h2><p><a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
 </p><h2>Type xmlTextReaderErrorFunc *:</h2><p><a href="html/libxml-xmlreader.html#xmlTextReaderGetErrorHandler">xmlTextReaderGetErrorHandler</a><br />
@@ -1820,6 +1827,7 @@
 <a href="html/libxml-xmlreader.html#xmlTextReaderRelaxNGValidate">xmlTextReaderRelaxNGValidate</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderValue">xmlTextReaderValue</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderXmlLang">xmlTextReaderXmlLang</a><br />
 </p><h2>Type xmlTextWriterPtr:</h2><p><a href="html/libxml-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a><br />
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html
index 253679b..4ad839d 100644
--- a/doc/APIsymbols.html
+++ b/doc/APIsymbols.html
@@ -1227,6 +1227,7 @@
 <a href="html/libxml-xmlIO.html#xmlAllocParserInputBuffer">xmlAllocParserInputBuffer</a><br />
 <a href="html/libxml-tree.html#xmlAttr">xmlAttr</a><br />
 <a href="html/libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a><br />
+<a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
 <a href="html/libxml-tree.html#xmlAttribute">xmlAttribute</a><br />
 <a href="html/libxml-tree.html#xmlAttributeDefault">xmlAttributeDefault</a><br />
 <a href="html/libxml-tree.html#xmlAttributePtr">xmlAttributePtr</a><br />
@@ -1277,6 +1278,7 @@
 <a href="html/libxml-tree.html#xmlBufferWriteQuotedString">xmlBufferWriteQuotedString</a><br />
 <a href="html/libxml-tree.html#xmlBuildQName">xmlBuildQName</a><br />
 <a href="html/libxml-uri.html#xmlBuildURI">xmlBuildURI</a><br />
+<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocSave">xmlC14NDocSave</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocSaveTo">xmlC14NDocSaveTo</a><br />
@@ -2302,6 +2304,7 @@
 <a href="html/libxml-xmlreader.html#xmlTextReaderRelaxNGValidate">xmlTextReaderRelaxNGValidate</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderValue">xmlTextReaderValue</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderXmlLang">xmlTextReaderXmlLang</a><br />
 <a href="html/libxml-xmlwriter.html#xmlTextWriter">xmlTextWriter</a><br />
diff --git a/doc/benchmark.gif b/doc/benchmark.gif
index dc5eb5c..4bbd3f3 100644
--- a/doc/benchmark.gif
+++ b/doc/benchmark.gif
Binary files differ
diff --git a/doc/html/libxml-encoding.html b/doc/html/libxml-encoding.html
index e41ac84..e2e61b6 100644
--- a/doc/html/libxml-encoding.html
+++ b/doc/html/libxml-encoding.html
@@ -90,7 +90,7 @@
 </pre><p>Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the UTF-8 result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of chars in the original encoding</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div><br />
 <h3><a name="xmlCharEncodingOutputFunc" id="xmlCharEncodingOutputFunc"></a>Function type: xmlCharEncodingOutputFunc</h3><pre class="programlisting">Function type: xmlCharEncodingOutputFunc
 int	xmlCharEncodingOutputFunc	(unsigned char * out, <br />					 int * outlen, <br />					 const unsigned char * in, <br />					 int * inlen)
-</pre><p>Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of ocetes consumed.</td></tr></tbody></table></div><br />
+</pre><p>Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div><br />
 <h3><a name="xmlCleanupCharEncodingHandlers" id="xmlCleanupCharEncodingHandlers"></a>Function: xmlCleanupCharEncodingHandlers</h3><pre class="programlisting">void	xmlCleanupCharEncodingHandlers	(void)<br />
 </pre><p>Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases.</p>
 <h3><a name="xmlCleanupEncodingAliases" id="xmlCleanupEncodingAliases"></a>Function: xmlCleanupEncodingAliases</h3><pre class="programlisting">void	xmlCleanupEncodingAliases	(void)<br />
diff --git a/doc/html/libxml-parser.html b/doc/html/libxml-parser.html
index ec5f724..876fc56 100644
--- a/doc/html/libxml-parser.html
+++ b/doc/html/libxml-parser.html
@@ -108,6 +108,7 @@
 <pre class="programlisting">Function type: <a href="#warningSAXFunc">warningSAXFunc</a>
 void	<a href="#warningSAXFunc">warningSAXFunc</a>			(void * ctx, <br />					 const char * msg, <br />					 ... ...)
 </pre>
+<pre class="programlisting">long	<a href="#xmlByteConsumed">xmlByteConsumed</a>			(<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)</pre>
 <pre class="programlisting">void	<a href="#xmlCleanupParser">xmlCleanupParser</a>		(void)</pre>
 <pre class="programlisting">void	<a href="#xmlClearNodeInfoSeq">xmlClearNodeInfoSeq</a>		(<a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq)</pre>
 <pre class="programlisting">void	<a href="#xmlClearParserCtxt">xmlClearParserCtxt</a>		(<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)</pre>
@@ -353,7 +354,9 @@
 <h3><a name="warningSAXFunc" id="warningSAXFunc"></a>Function type: warningSAXFunc</h3><pre class="programlisting">Function type: warningSAXFunc
 void	warningSAXFunc			(void * ctx, <br />					 const char * msg, <br />					 ... ...)
 </pre><p>Display and format a warning messages, callback.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message to display/transmit</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra parameters for the message display</td></tr></tbody></table></div><br />
-<h3><a name="xmlCleanupParser" id="xmlCleanupParser"></a>Function: xmlCleanupParser</h3><pre class="programlisting">void	xmlCleanupParser		(void)<br />
+<h3><a name="xmlByteConsumed" id="xmlByteConsumed"></a>Function: xmlByteConsumed</h3><pre class="programlisting">long	xmlByteConsumed			(<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
+</pre><p>This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the index in bytes from the beginning of the entity or -1 in case the index could not be computed.</td></tr></tbody></table></div><h3><a name="xmlCleanupParser" id="xmlCleanupParser"></a>Function: xmlCleanupParser</h3><pre class="programlisting">void	xmlCleanupParser		(void)<br />
 </pre><p>Cleanup function for the XML library. It tries to reclaim all parsing related global memory allocated for the library processing. It doesn't deallocate any document related memory. Calling this function should not prevent reusing the library but one should call xmlCleanupParser() only when the process has finished using the library or XML document built with it.</p>
 <h3><a name="xmlClearNodeInfoSeq" id="xmlClearNodeInfoSeq"></a>Function: xmlClearNodeInfoSeq</h3><pre class="programlisting">void	xmlClearNodeInfoSeq		(<a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq)<br />
 </pre><p>-- Clear (release memory and reinitialize) node info sequence</p>
diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html
index c210949..9ef5569 100644
--- a/doc/html/libxml-tree.html
+++ b/doc/html/libxml-tree.html
@@ -63,6 +63,7 @@
 <pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlAddNextSibling">xmlAddNextSibling</a>	(<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br />					 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)</pre>
 <pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlAddPrevSibling">xmlAddPrevSibling</a>	(<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br />					 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)</pre>
 <pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlAddSibling">xmlAddSibling</a>		(<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br />					 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)</pre>
+<pre class="programlisting">void	<a href="#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a>	(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />					 <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string)</pre>
 <pre class="programlisting">void	<a href="#xmlBufferAdd">xmlBufferAdd</a>			(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str, <br />					 int len)</pre>
 <pre class="programlisting">void	<a href="#xmlBufferAddHead">xmlBufferAddHead</a>		(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str, <br />					 int len)</pre>
 <pre class="programlisting">void	<a href="#xmlBufferCCat">xmlBufferCCat</a>			(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 const char * str)</pre>
@@ -544,6 +545,7 @@
     <a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a>	raw	: if encoder != NULL buffer for raw input
     int	compressed	: -1=unknown, 0=not compressed, 1=compres
     int	error
+    unsigned long	rawconsumed	: amount consumed from raw
 }</pre><h3><a name="xmlRef" id="xmlRef">Structure xmlRef</a></h3><pre class="programlisting">Structure xmlRef<br />struct _xmlRef {
     struct _xmlRef *	next	: next Ref
     const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *	value	: The Ref name
@@ -598,7 +600,9 @@
 </pre><p>Add a new node @elem as the previous sibling of @cur merging adjacent TEXT nodes (@elem may be freed) If the new node was already inserted in a document it is first unlinked from its existing context. If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an <a href="libxml-SAX.html#attribute">attribute</a> with equal name, it is first destroyed.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the child node</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the new node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new node or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlAddSibling" id="xmlAddSibling"></a>Function: xmlAddSibling</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlAddSibling		(<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br />					 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)<br />
 </pre><p>Add a new element @elem to the list of siblings of @cur merging adjacent TEXT nodes (@elem may be freed) If the new element was already inserted in a document it is first unlinked from its existing context.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the child node</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the new node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new element or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlBufferAdd" id="xmlBufferAdd"></a>Function: xmlBufferAdd</h3><pre class="programlisting">void	xmlBufferAdd			(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str, <br />					 int len)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the child node</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the new node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new element or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlAttrSerializeTxtContent" id="xmlAttrSerializeTxtContent"></a>Function: xmlAttrSerializeTxtContent</h3><pre class="programlisting">void	xmlAttrSerializeTxtContent	(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />					 <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string)<br />
+</pre><p>Serialize text <a href="libxml-SAX.html#attribute">attribute</a> values to an xml simple buffer</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the XML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>attr</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> node</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlBufferAdd" id="xmlBufferAdd"></a>Function: xmlBufferAdd</h3><pre class="programlisting">void	xmlBufferAdd			(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str, <br />					 int len)<br />
 </pre><p>Add a string range to an XML buffer. if len == -1, the length of str is recomputed.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the buffer to dump</td></tr><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the #xmlChar string</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the number of #xmlChar to add</td></tr></tbody></table></div><h3><a name="xmlBufferAddHead" id="xmlBufferAddHead"></a>Function: xmlBufferAddHead</h3><pre class="programlisting">void	xmlBufferAddHead		(<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br />					 const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str, <br />					 int len)<br />
 </pre><p>Add a string range to the beginning of an XML buffer. if len == -1, the length of @str is recomputed.</p>
diff --git a/doc/html/libxml-xmlreader.html b/doc/html/libxml-xmlreader.html
index 1086e53..5f98b1c 100644
--- a/doc/html/libxml-xmlreader.html
+++ b/doc/html/libxml-xmlreader.html
@@ -91,6 +91,7 @@
 <pre class="programlisting">int	<a href="#xmlTextReaderRelaxNGValidate">xmlTextReaderRelaxNGValidate</a>	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br />					 const char * rng)</pre>
 <pre class="programlisting">void	<a href="#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a>	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br />					 <a href="libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a> f, <br />					 void * arg)</pre>
 <pre class="programlisting">int	<a href="#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a>	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br />					 int prop, <br />					 int value)</pre>
+<pre class="programlisting">void	<a href="#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a>	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br />						 <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> f, <br />						 void * arg)</pre>
 <pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlTextReaderValue">xmlTextReaderValue</a>	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)</pre>
 <pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlTextReaderXmlLang">xmlTextReaderXmlLang</a>	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)</pre>
 <h2>Description</h2>
@@ -273,7 +274,9 @@
 </pre><p>Register a callback function that will be called on error and warnings. If @f is NULL, the default error and warning handlers are restored.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>f</tt></i>:</span></td><td>the callback function to call on error and warnings</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>a user argument to pass to the callback function</td></tr></tbody></table></div><h3><a name="xmlTextReaderSetParserProp" id="xmlTextReaderSetParserProp"></a>Function: xmlTextReaderSetParserProp</h3><pre class="programlisting">int	xmlTextReaderSetParserProp	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br />					 int prop, <br />					 int value)<br />
 </pre><p>Change the parser processing behaviour by changing some of its internal properties. Note that some properties can only be changed before any read has been done.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>prop</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlParserProperties">xmlParserProperties</a> to set</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>usually 0 or 1 to (de)activate it</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the call was successful, or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextReaderValue" id="xmlTextReaderValue"></a>Function: xmlTextReaderValue</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderValue	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>prop</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlParserProperties">xmlParserProperties</a> to set</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>usually 0 or 1 to (de)activate it</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the call was successful, or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextReaderSetStructuredErrorHandler" id="xmlTextReaderSetStructuredErrorHandler"></a>Function: xmlTextReaderSetStructuredErrorHandler</h3><pre class="programlisting">void	xmlTextReaderSetStructuredErrorHandler	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br />						 <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> f, <br />						 void * arg)<br />
+</pre><p>Register a callback function that will be called on error and warnings. If @f is NULL, the default error and warning handlers are restored.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>f</tt></i>:</span></td><td>the callback function to call on error and warnings</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>a user argument to pass to the callback function</td></tr></tbody></table></div><h3><a name="xmlTextReaderValue" id="xmlTextReaderValue"></a>Function: xmlTextReaderValue</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderValue	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
 </pre><p>Provides the text value of the node if present</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the string or NULL if not available. The result must be deallocated with xmlFree()</td></tr></tbody></table></div><h3><a name="xmlTextReaderXmlLang" id="xmlTextReaderXmlLang"></a>Function: xmlTextReaderXmlLang</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderXmlLang	(<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
 </pre><p>The xml:lang scope within which the node resides.</p>
diff --git a/doc/index.html b/doc/index.html
index 307e7ee..79d9404 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -265,7 +265,7 @@
     projects.</li>
 </ul>
                                   <p>Results of the <a href="http://xmlbench.sourceforge.net/results/benchmark/index.html">xmlbench
-benchmark</a> on sourceforge 19 March 2003 (smaller is better):</p>
+benchmark</a> on sourceforge 8 February 2004 (smaller is better):</p>
                                   <p align="center">
                                     <img src="benchmark.gif" alt="benchmark results for Expat Xerces libxml2 Oracle and Sun toolkits" />
                                   </p>
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 4ebef9a..9093738 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -726,7 +726,7 @@
      <exports symbol='xmlParseDocument' type='function'/>
      <exports symbol='xmlCreateIOParserCtxt' type='function'/>
      <exports symbol='referenceSAXFunc' type='function'/>
-     <exports symbol='xmlCtxtResetPush' type='function'/>
+     <exports symbol='getParameterEntitySAXFunc' type='function'/>
      <exports symbol='ignorableWhitespaceSAXFunc' type='function'/>
      <exports symbol='xmlSAXParseDoc' type='function'/>
      <exports symbol='xmlReadMemory' type='function'/>
@@ -736,7 +736,7 @@
      <exports symbol='endElementSAXFunc' type='function'/>
      <exports symbol='xmlCtxtReadMemory' type='function'/>
      <exports symbol='xmlParserFindNodeInfoIndex' type='function'/>
-     <exports symbol='xmlSAXParseFileWithData' type='function'/>
+     <exports symbol='xmlByteConsumed' type='function'/>
      <exports symbol='xmlCtxtReset' type='function'/>
      <exports symbol='xmlRecoverDoc' type='function'/>
      <exports symbol='xmlNewIOInputStream' type='function'/>
@@ -772,7 +772,6 @@
      <exports symbol='xmlReadIO' type='function'/>
      <exports symbol='xmlGetFeature' type='function'/>
      <exports symbol='xmlParseBalancedChunkMemoryRecover' type='function'/>
-     <exports symbol='hasExternalSubsetSAXFunc' type='function'/>
      <exports symbol='xmlIOParseDTD' type='function'/>
      <exports symbol='xmlFreeParserCtxt' type='function'/>
      <exports symbol='xmlReadDoc' type='function'/>
@@ -784,14 +783,16 @@
      <exports symbol='commentSAXFunc' type='function'/>
      <exports symbol='xmlCleanupParser' type='function'/>
      <exports symbol='attributeSAXFunc' type='function'/>
-     <exports symbol='getParameterEntitySAXFunc' type='function'/>
+     <exports symbol='hasExternalSubsetSAXFunc' type='function'/>
      <exports symbol='isStandaloneSAXFunc' type='function'/>
      <exports symbol='startDocumentSAXFunc' type='function'/>
      <exports symbol='xmlInitParserCtxt' type='function'/>
      <exports symbol='xmlClearParserCtxt' type='function'/>
      <exports symbol='xmlParserInputGrow' type='function'/>
      <exports symbol='xmlParseExternalEntity' type='function'/>
+     <exports symbol='xmlCtxtResetPush' type='function'/>
      <exports symbol='externalSubsetSAXFunc' type='function'/>
+     <exports symbol='xmlSAXParseFileWithData' type='function'/>
      <exports symbol='resolveEntitySAXFunc' type='function'/>
      <exports symbol='setDocumentLocatorSAXFunc' type='function'/>
      <exports symbol='xmlPedanticParserDefault' type='function'/>
@@ -1255,7 +1256,7 @@
      <exports symbol='_xmlElementContent' type='struct'/>
      <exports symbol='xmlNodeSetContentLen' type='function'/>
      <exports symbol='xmlDocCopyNode' type='function'/>
-     <exports symbol='xmlDocSetRootElement' type='function'/>
+     <exports symbol='xmlAddSibling' type='function'/>
      <exports symbol='xmlGetProp' type='function'/>
      <exports symbol='xmlNewNsPropEatName' type='function'/>
      <exports symbol='xmlSearchNs' type='function'/>
@@ -1273,7 +1274,7 @@
      <exports symbol='xmlUnlinkNode' type='function'/>
      <exports symbol='xmlSplitQName3' type='function'/>
      <exports symbol='xmlRemoveProp' type='function'/>
-     <exports symbol='xmlAddSibling' type='function'/>
+     <exports symbol='xmlDocSetRootElement' type='function'/>
      <exports symbol='xmlNodeSetName' type='function'/>
      <exports symbol='xmlNewDocFragment' type='function'/>
      <exports symbol='xmlDocGetRootElement' type='function'/>
@@ -1299,6 +1300,7 @@
      <exports symbol='xmlNodeListGetRawString' type='function'/>
      <exports symbol='xmlStringLenGetNodeList' type='function'/>
      <exports symbol='xmlSaveFormatFile' type='function'/>
+     <exports symbol='xmlSaveFormatFileEnc' type='function'/>
      <exports symbol='xmlGetNodePath' type='function'/>
      <exports symbol='xmlElemDump' type='function'/>
      <exports symbol='xmlCopyPropList' type='function'/>
@@ -1347,7 +1349,7 @@
      <exports symbol='xmlNewCDataBlock' type='function'/>
      <exports symbol='xmlSetCompressMode' type='function'/>
      <exports symbol='xmlSetTreeDoc' type='function'/>
-     <exports symbol='xmlSaveFormatFileEnc' type='function'/>
+     <exports symbol='xmlAttrSerializeTxtContent' type='function'/>
      <exports symbol='xmlBufferCreate' type='function'/>
      <exports symbol='xmlCopyNodeList' type='function'/>
      <exports symbol='xmlNewDocNodeEatName' type='function'/>
@@ -2304,6 +2306,7 @@
      <exports symbol='xmlReaderForDoc' type='function'/>
      <exports symbol='xmlReaderNewIO' type='function'/>
      <exports symbol='xmlTextReaderMoveToElement' type='function'/>
+     <exports symbol='xmlTextReaderSetStructuredErrorHandler' type='function'/>
      <exports symbol='xmlTextReaderClose' type='function'/>
      <exports symbol='xmlTextReaderReadInnerXml' type='function'/>
      <exports symbol='xmlReaderWalker' type='function'/>
@@ -4969,6 +4972,7 @@
       <field name='raw' type='xmlBufferPtr' info=' if encoder != NULL buffer for raw input'/>
       <field name='compressed' type='int' info=' -1=unknown, 0=not compressed, 1=compressed'/>
       <field name='error' type='int' info=''/>
+      <field name='rawconsumed' type='unsigned long' info=' amount consumed from raw'/>
     </struct>
     <typedef name='xmlParserInputBufferPtr' file='tree' type='xmlParserInputBuffer *'/>
     <typedef name='xmlParserInputPtr' file='tree' type='xmlParserInput *'/>
@@ -6642,6 +6646,14 @@
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known'/>
     </function>
+    <function name='xmlAttrSerializeTxtContent' file='tree'>
+      <info>Serialize text attribute values to an xml simple buffer</info>
+      <return type='void'/>
+      <arg name='buf' type='xmlBufferPtr' info='the XML buffer output'/>
+      <arg name='doc' type='xmlDocPtr' info='the document'/>
+      <arg name='attr' type='xmlAttrPtr' info='the attribute node'/>
+      <arg name='string' type='const xmlChar *' info=''/>
+    </function>
     <function name='xmlAutomataCompile' file='xmlautomata'>
       <info>Compile the automata into a Reg Exp ready for being executed. The automata should be free after this point.</info>
       <return type='xmlRegexpPtr' info='the compiled regexp or NULL in case of error'/>
@@ -6875,6 +6887,11 @@
       <arg name='URI' type='const xmlChar *' info='the URI instance found in the document'/>
       <arg name='base' type='const xmlChar *' info='the base value'/>
     </function>
+    <function name='xmlByteConsumed' file='parser'>
+      <info>This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.</info>
+      <return type='long' info='the index in bytes from the beginning of the entity or -1 in case the index could not be computed.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
+    </function>
     <function name='xmlC14NDocDumpMemory' file='c14n'>
       <info>Dumps the canonized image of given XML document into memory. For details see &quot;Canonical XML&quot; (http://www.w3.org/TR/xml-c14n) or &quot;Exclusive XML Canonicalization&quot; (http://www.w3.org/TR/xml-exc-c14n)</info>
       <return type='int' info='the number of bytes written on success or a negative value on fail'/>
@@ -7069,7 +7086,7 @@
     </functype>
     <functype name='xmlCharEncodingOutputFunc' file='encoding'>
       <info>Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.</info>
-      <return type='int' info='the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of ocetes consumed.'/>
+      <return type='int' info='the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets produced.'/>
       <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
       <arg name='outlen' type='int *' info='the length of @out'/>
       <arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
@@ -11890,6 +11907,13 @@
       <arg name='prop' type='int' info='the xmlParserProperties to set'/>
       <arg name='value' type='int' info='usually 0 or 1 to (de)activate it'/>
     </function>
+    <function name='xmlTextReaderSetStructuredErrorHandler' file='xmlreader'>
+      <info>Register a callback function that will be called on error and warnings.  If @f is NULL, the default error and warning handlers are restored.</info>
+      <return type='void'/>
+      <arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
+      <arg name='f' type='xmlStructuredErrorFunc' info='the callback function to call on error and warnings'/>
+      <arg name='arg' type='void *' info='a user argument to pass to the callback function'/>
+    </function>
     <function name='xmlTextReaderValue' file='xmlreader'>
       <info>Provides the text value of the node if present</info>
       <return type='xmlChar *' info='the string or NULL if not available. The result must be deallocated with xmlFree()'/>
diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml
index b7112a9..bb8704e 100644
--- a/doc/libxml2-refs.xml
+++ b/doc/libxml2-refs.xml
@@ -1221,6 +1221,7 @@
     <reference name='xmlAllocParserInputBuffer' href='html/libxml-xmlIO.html#xmlAllocParserInputBuffer'/>
     <reference name='xmlAttr' href='html/libxml-tree.html#xmlAttr'/>
     <reference name='xmlAttrPtr' href='html/libxml-tree.html#xmlAttrPtr'/>
+    <reference name='xmlAttrSerializeTxtContent' href='html/libxml-tree.html#xmlAttrSerializeTxtContent'/>
     <reference name='xmlAttribute' href='html/libxml-tree.html#xmlAttribute'/>
     <reference name='xmlAttributeDefault' href='html/libxml-tree.html#xmlAttributeDefault'/>
     <reference name='xmlAttributePtr' href='html/libxml-tree.html#xmlAttributePtr'/>
@@ -1271,6 +1272,7 @@
     <reference name='xmlBufferWriteQuotedString' href='html/libxml-tree.html#xmlBufferWriteQuotedString'/>
     <reference name='xmlBuildQName' href='html/libxml-tree.html#xmlBuildQName'/>
     <reference name='xmlBuildURI' href='html/libxml-uri.html#xmlBuildURI'/>
+    <reference name='xmlByteConsumed' href='html/libxml-parser.html#xmlByteConsumed'/>
     <reference name='xmlC14NDocDumpMemory' href='html/libxml-c14n.html#xmlC14NDocDumpMemory'/>
     <reference name='xmlC14NDocSave' href='html/libxml-c14n.html#xmlC14NDocSave'/>
     <reference name='xmlC14NDocSaveTo' href='html/libxml-c14n.html#xmlC14NDocSaveTo'/>
@@ -2296,6 +2298,7 @@
     <reference name='xmlTextReaderRelaxNGValidate' href='html/libxml-xmlreader.html#xmlTextReaderRelaxNGValidate'/>
     <reference name='xmlTextReaderSetErrorHandler' href='html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler'/>
     <reference name='xmlTextReaderSetParserProp' href='html/libxml-xmlreader.html#xmlTextReaderSetParserProp'/>
+    <reference name='xmlTextReaderSetStructuredErrorHandler' href='html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler'/>
     <reference name='xmlTextReaderValue' href='html/libxml-xmlreader.html#xmlTextReaderValue'/>
     <reference name='xmlTextReaderXmlLang' href='html/libxml-xmlreader.html#xmlTextReaderXmlLang'/>
     <reference name='xmlTextWriter' href='html/libxml-xmlwriter.html#xmlTextWriter'/>
@@ -4120,6 +4123,7 @@
       <ref name='xmlAllocParserInputBuffer'/>
       <ref name='xmlAttr'/>
       <ref name='xmlAttrPtr'/>
+      <ref name='xmlAttrSerializeTxtContent'/>
       <ref name='xmlAttribute'/>
       <ref name='xmlAttributeDefault'/>
       <ref name='xmlAttributePtr'/>
@@ -4170,6 +4174,7 @@
       <ref name='xmlBufferWriteQuotedString'/>
       <ref name='xmlBuildQName'/>
       <ref name='xmlBuildURI'/>
+      <ref name='xmlByteConsumed'/>
       <ref name='xmlC14NDocDumpMemory'/>
       <ref name='xmlC14NDocSave'/>
       <ref name='xmlC14NDocSaveTo'/>
@@ -5195,6 +5200,7 @@
       <ref name='xmlTextReaderRelaxNGValidate'/>
       <ref name='xmlTextReaderSetErrorHandler'/>
       <ref name='xmlTextReaderSetParserProp'/>
+      <ref name='xmlTextReaderSetStructuredErrorHandler'/>
       <ref name='xmlTextReaderValue'/>
       <ref name='xmlTextReaderXmlLang'/>
       <ref name='xmlTextWriter'/>
@@ -5832,6 +5838,7 @@
       <ref name='htmlNodeStatus'/>
     </type>
     <type name='long'>
+      <ref name='xmlByteConsumed'/>
       <ref name='xmlGetLineNo'/>
       <ref name='xmlXPathOrderDocElems'/>
     </type>
@@ -6618,6 +6625,7 @@
       <ref name='xmlAddID'/>
       <ref name='xmlAddNotationDecl'/>
       <ref name='xmlAddRef'/>
+      <ref name='xmlAttrSerializeTxtContent'/>
       <ref name='xmlAutomataNewCountTrans'/>
       <ref name='xmlAutomataNewOnceTrans'/>
       <ref name='xmlAutomataNewTransition'/>
@@ -7295,6 +7303,7 @@
       <ref name='xmlStructuredErrorFunc'/>
       <ref name='xmlTextReaderErrorFunc'/>
       <ref name='xmlTextReaderSetErrorHandler'/>
+      <ref name='xmlTextReaderSetStructuredErrorHandler'/>
       <ref name='xmlThrDefSetGenericErrorFunc'/>
       <ref name='xmlThrDefSetStructuredErrorFunc'/>
       <ref name='xmlValidityErrorFunc'/>
@@ -7325,6 +7334,7 @@
     <type name='xmlAttrPtr'>
       <ref name='xmlAddID'/>
       <ref name='xmlAddRef'/>
+      <ref name='xmlAttrSerializeTxtContent'/>
       <ref name='xmlCopyProp'/>
       <ref name='xmlCopyPropList'/>
       <ref name='xmlDebugDumpAttr'/>
@@ -7389,6 +7399,7 @@
     </type>
     <type name='xmlBufferPtr'>
       <ref name='htmlNodeDump'/>
+      <ref name='xmlAttrSerializeTxtContent'/>
       <ref name='xmlBufferAdd'/>
       <ref name='xmlBufferAddHead'/>
       <ref name='xmlBufferCCat'/>
@@ -7568,6 +7579,7 @@
       <ref name='xmlAddDtdEntity'/>
       <ref name='xmlAddID'/>
       <ref name='xmlAddRef'/>
+      <ref name='xmlAttrSerializeTxtContent'/>
       <ref name='xmlC14NDocDumpMemory'/>
       <ref name='xmlC14NDocSave'/>
       <ref name='xmlC14NDocSaveTo'/>
@@ -8167,6 +8179,7 @@
       <ref name='namePush'/>
       <ref name='nodePop'/>
       <ref name='nodePush'/>
+      <ref name='xmlByteConsumed'/>
       <ref name='xmlCheckHTTPInput'/>
       <ref name='xmlClearParserCtxt'/>
       <ref name='xmlCtxtReadDoc'/>
@@ -8481,6 +8494,7 @@
     </type>
     <type name='xmlStructuredErrorFunc'>
       <ref name='xmlSetStructuredErrorFunc'/>
+      <ref name='xmlTextReaderSetStructuredErrorHandler'/>
       <ref name='xmlThrDefSetStructuredErrorFunc'/>
     </type>
     <type name='xmlTextReaderErrorFunc'>
@@ -8556,6 +8570,7 @@
       <ref name='xmlTextReaderRelaxNGValidate'/>
       <ref name='xmlTextReaderSetErrorHandler'/>
       <ref name='xmlTextReaderSetParserProp'/>
+      <ref name='xmlTextReaderSetStructuredErrorHandler'/>
       <ref name='xmlTextReaderValue'/>
       <ref name='xmlTextReaderXmlLang'/>
     </type>
@@ -9471,6 +9486,7 @@
       <ref name='startElementSAXFunc'/>
       <ref name='unparsedEntityDeclSAXFunc'/>
       <ref name='warningSAXFunc'/>
+      <ref name='xmlByteConsumed'/>
       <ref name='xmlCleanupParser'/>
       <ref name='xmlClearNodeInfoSeq'/>
       <ref name='xmlClearParserCtxt'/>
@@ -9942,6 +9958,7 @@
       <ref name='xmlAddSibling'/>
       <ref name='xmlAttr'/>
       <ref name='xmlAttrPtr'/>
+      <ref name='xmlAttrSerializeTxtContent'/>
       <ref name='xmlAttribute'/>
       <ref name='xmlAttributeDefault'/>
       <ref name='xmlAttributePtr'/>
@@ -11049,6 +11066,7 @@
       <ref name='xmlTextReaderRelaxNGValidate'/>
       <ref name='xmlTextReaderSetErrorHandler'/>
       <ref name='xmlTextReaderSetParserProp'/>
+      <ref name='xmlTextReaderSetStructuredErrorHandler'/>
       <ref name='xmlTextReaderValue'/>
       <ref name='xmlTextReaderXmlLang'/>
     </file>
@@ -14575,6 +14593,7 @@
           <ref name='xmlRegisterInputCallbacks'/>
           <ref name='xmlRegisterOutputCallbacks'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
+          <ref name='xmlTextReaderSetStructuredErrorHandler'/>
           <ref name='xmlXPathRegisterFunc'/>
           <ref name='xmlXPathRegisterFuncNS'/>
           <ref name='xmlXPathRegisterNs'/>
@@ -14873,6 +14892,9 @@
         <word name='Send'>
           <ref name='xmlNanoFTPQuit'/>
         </word>
+        <word name='Serialize'>
+          <ref name='xmlAttrSerializeTxtContent'/>
+        </word>
         <word name='Set'>
           <ref name='htmlHandleOmittedElem'/>
           <ref name='initGenericErrorDefaultFunc'/>
@@ -16158,6 +16180,7 @@
         </word>
         <word name='amount'>
           <ref name='INPUT_CHUNK'/>
+          <ref name='_xmlParserInputBuffer'/>
           <ref name='xmlMemUsed'/>
           <ref name='xmlParserInputBufferGrow'/>
           <ref name='xmlParserInputBufferRead'/>
@@ -16510,6 +16533,7 @@
         <word name='beginning'>
           <ref name='xmlBufferAddHead'/>
           <ref name='xmlBufferShrink'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlListInsert'/>
           <ref name='xmlListPushFront'/>
           <ref name='xmlStringCurrentChar'/>
@@ -16714,6 +16738,7 @@
           <ref name='_xmlParserCtxt'/>
           <ref name='xlinkIsLink'/>
           <ref name='xmlACatalogAdd'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlCatalogAdd'/>
           <ref name='xmlCharEncFirstLine'/>
           <ref name='xmlCheckUTF8'/>
@@ -16749,6 +16774,7 @@
           <ref name='htmlSaveFileEnc'/>
           <ref name='htmlSaveFileFormat'/>
           <ref name='xmlBufferCreateStatic'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlCharEncFirstLine'/>
           <ref name='xmlCharEncInFunc'/>
           <ref name='xmlCharEncOutFunc'/>
@@ -16793,6 +16819,7 @@
           <ref name='xmlTextReaderExpand'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
           <ref name='xmlTextReaderSetParserProp'/>
+          <ref name='xmlTextReaderSetStructuredErrorHandler'/>
           <ref name='xmlValidateOneElement'/>
           <ref name='xmlXPathEvalPredicate'/>
           <ref name='xmlXPathEvaluatePredicateResult'/>
@@ -17454,6 +17481,7 @@
         </word>
         <word name='computed'>
           <ref name='_xmlEntity'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlSchemaValPredefTypeNode'/>
           <ref name='xmlSchemaValidatePredefinedType'/>
         </word>
@@ -17543,6 +17571,7 @@
         </word>
         <word name='constant'>
           <ref name='XML_SAX2_MAGIC'/>
+          <ref name='xmlByteConsumed'/>
         </word>
         <word name='constraint'>
           <ref name='xmlParseEntityRef'/>
@@ -17566,6 +17595,7 @@
           <ref name='UTF8ToHtml'/>
           <ref name='UTF8Toisolat1'/>
           <ref name='_xmlParserInput'/>
+          <ref name='_xmlParserInputBuffer'/>
           <ref name='docbEncodeEntities'/>
           <ref name='htmlEncodeEntities'/>
           <ref name='isolat1ToUTF8'/>
@@ -17777,10 +17807,15 @@
           <ref name='xmlGetParameterEntity'/>
           <ref name='xmlXPathTranslateFunction'/>
         </word>
+        <word name='cost'>
+          <ref name='xmlByteConsumed'/>
+        </word>
         <word name='costly'>
           <ref name='XML_MAX_NAMELEN'/>
+          <ref name='xmlByteConsumed'/>
         </word>
         <word name='could'>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlTextReaderRelaxNGSetSchema'/>
           <ref name='xmlTextReaderRelaxNGValidate'/>
         </word>
@@ -19303,6 +19338,9 @@
           <ref name='xmlTextReaderCurrentDoc'/>
           <ref name='xmlTextReaderPreservePattern'/>
         </word>
+        <word name='finishing'>
+          <ref name='xmlByteConsumed'/>
+        </word>
         <word name='firs'>
           <ref name='xmlCharEncOutFunc'/>
         </word>
@@ -19785,6 +19823,7 @@
           <ref name='xmlRegisterDefaultInputCallbacks'/>
           <ref name='xmlRegisterDefaultOutputCallbacks'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
+          <ref name='xmlTextReaderSetStructuredErrorHandler'/>
         </word>
         <word name='handles'>
           <ref name='xmlSaveFileTo'/>
@@ -20225,6 +20264,7 @@
           <ref name='inputPush'/>
           <ref name='namePush'/>
           <ref name='nodePush'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlParserFindNodeInfoIndex'/>
           <ref name='xmlStrsub'/>
           <ref name='xmlTextReaderGetAttributeNo'/>
@@ -21752,6 +21792,9 @@
           <ref name='xmlCreatePushParserCtxt'/>
           <ref name='xmlParseEntityValue'/>
         </word>
+        <word name='non-UTF-8'>
+          <ref name='xmlByteConsumed'/>
+        </word>
         <word name='non-blank'>
           <ref name='xmlParseElementChildrenContentDecl'/>
         </word>
@@ -21970,9 +22013,6 @@
           <ref name='xmlStrPrintf'/>
           <ref name='xmlStrVPrintf'/>
         </word>
-        <word name='ocetes'>
-          <ref name='xmlCharEncodingOutputFunc'/>
-        </word>
         <word name='octets'>
           <ref name='UTF8ToHtml'/>
           <ref name='UTF8Toisolat1'/>
@@ -22367,6 +22407,7 @@
           <ref name='xmlCurrentChar'/>
           <ref name='xmlRelaxParserSetFlag'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
+          <ref name='xmlTextReaderSetStructuredErrorHandler'/>
         </word>
         <word name='passed'>
           <ref name='CHECK_ARITY'/>
@@ -22814,6 +22855,7 @@
           <ref name='xmlStringLenGetNodeList'/>
         </word>
         <word name='produced'>
+          <ref name='xmlCharEncodingOutputFunc'/>
           <ref name='xmlCurrentChar'/>
         </word>
         <word name='producing'>
@@ -22924,6 +22966,7 @@
         <word name='provides'>
           <ref name='endElementNsSAX2Func'/>
           <ref name='startElementNsSAX2Func'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlSAX2EndElementNs'/>
           <ref name='xmlSAX2StartElementNs'/>
         </word>
@@ -23404,6 +23447,7 @@
           <ref name='_htmlElemDesc'/>
         </word>
         <word name='relative'>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlTextReaderGetAttributeNo'/>
           <ref name='xmlTextReaderMoveToAttributeNo'/>
           <ref name='xmlUTF8Strloc'/>
@@ -23661,6 +23705,7 @@
         </word>
         <word name='restored'>
           <ref name='xmlTextReaderSetErrorHandler'/>
+          <ref name='xmlTextReaderSetStructuredErrorHandler'/>
         </word>
         <word name='restrict'>
           <ref name='xmlParseExternalID'/>
@@ -23786,6 +23831,7 @@
         </word>
         <word name='run'>
           <ref name='_xmlParserCtxt'/>
+          <ref name='xmlByteConsumed'/>
         </word>
         <word name='running'>
           <ref name='xmlKeepBlanksDefault'/>
@@ -24166,6 +24212,7 @@
         </word>
         <word name='simple'>
           <ref name='xlinkSimpleLinkFunk'/>
+          <ref name='xmlAttrSerializeTxtContent'/>
           <ref name='xmlFreeMutex'/>
           <ref name='xmlHashScanner'/>
           <ref name='xmlIsRef'/>
@@ -24437,6 +24484,7 @@
           <ref name='startDocument'/>
           <ref name='startDocumentSAXFunc'/>
           <ref name='startElementNsSAX2Func'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlParseStartTag'/>
           <ref name='xmlRelaxNGValidatePushElement'/>
           <ref name='xmlSAX2StartDocument'/>
@@ -24458,6 +24506,7 @@
           <ref name='xmlAutomataNewOnceTrans'/>
           <ref name='xmlAutomataNewTransition'/>
           <ref name='xmlAutomataNewTransition2'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlNewCharRef'/>
           <ref name='xmlNewTextWriterTree'/>
           <ref name='xmlXPathOrderDocElems'/>
@@ -25778,12 +25827,14 @@
           <ref name='xmlSchemaSetValidErrors'/>
           <ref name='xmlSearchNs'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
+          <ref name='xmlTextReaderSetStructuredErrorHandler'/>
           <ref name='xmlValidityWarningFunc'/>
         </word>
         <word name='warnings'>
           <ref name='_xmlParserCtxt'/>
           <ref name='xmlPedanticParserDefault'/>
           <ref name='xmlTextReaderSetErrorHandler'/>
+          <ref name='xmlTextReaderSetStructuredErrorHandler'/>
         </word>
         <word name='way'>
           <ref name='HTML_COMMENT_NODE'/>
@@ -26959,6 +27010,7 @@
           <ref name='htmlReadDoc'/>
           <ref name='xmlBufferCCat'/>
           <ref name='xmlBufferCat'/>
+          <ref name='xmlByteConsumed'/>
           <ref name='xmlCtxtReadDoc'/>
           <ref name='xmlOutputBufferWriteString'/>
           <ref name='xmlParseBalancedChunkMemory'/>
diff --git a/doc/xml.html b/doc/xml.html
index f703592..3df6b48 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -113,7 +113,7 @@
 
 <p>Results of the <a
 href="http://xmlbench.sourceforge.net/results/benchmark/index.html">xmlbench
-benchmark</a> on sourceforge 19 March 2003 (smaller is better):</p>
+benchmark</a> on sourceforge 8 February 2004 (smaller is better):</p>
 
 <p align="center"><img src="benchmark.gif"
 alt="benchmark results for Expat Xerces libxml2 Oracle and Sun toolkits"></p>
diff --git a/encoding.c b/encoding.c
index e5fbf19..bc8a435 100644
--- a/encoding.c
+++ b/encoding.c
@@ -2100,6 +2100,81 @@
     return(ret);
 }
 
+/**
+ * xmlByteConsumed:
+ * @ctxt: an XML parser context
+ *
+ * This function provides the current index of the parser relative
+ * to the start of the current entity. This function is computed in
+ * bytes from the beginning starting at zero and finishing at the
+ * size in byte of the file if parsing a file. The function is
+ * of constant cost if the input is UTF-8 but can be costly if run
+ * on non-UTF-8 input.
+ *
+ * Returns the index in bytes from the beginning of the entity or -1
+ *         in case the index could not be computed.
+ */
+long
+xmlByteConsumed(xmlParserCtxtPtr ctxt) {
+    xmlParserInputPtr in;
+    
+    if (ctxt == NULL) return(-1);
+    in = ctxt->input;
+    if (in == NULL)  return(-1);
+    if ((in->buf != NULL) && (in->buf->encoder != NULL)) {
+        unsigned int unused = 0;
+	xmlCharEncodingHandler * handler = in->buf->encoder;
+        /*
+	 * Encoding conversion, compute the number of unused original
+	 * bytes from the input not consumed and substract that from
+	 * the raw consumed value, this is not a cheap operation
+	 */
+        if (in->end - in->cur > 0) {
+	    static unsigned char convbuf[32000];
+	    unsigned char *cur = in->cur;
+	    int toconv = in->end - in->cur, written = 32000;
+
+	    int ret;
+
+	    if (handler->output != NULL) {
+	        do {
+		    toconv = in->end - cur;
+		    written = 32000;
+		    ret = handler->output(&convbuf[0], &written,
+				      cur, &toconv);
+		    if (ret == -1) return(-1);
+		    unused += written;
+		    cur += toconv;
+		} while (ret == -2);
+#ifdef LIBXML_ICONV_ENABLED
+	    } else if (handler->iconv_out != NULL) {
+	        do {
+		    toconv = in->end - cur;
+		    written = 32000;
+		    ret = xmlIconvWrapper(handler->iconv_out, &convbuf[0],
+	                      &written, cur, &toconv);
+		    if (ret == -1) {
+		        if (written > 0)
+			    ret = -2;
+			else
+			    return(-1);
+		    }
+		    unused += written;
+		    cur += toconv;
+		} while (ret == -2);
+#endif
+            } else {
+	        /* could not find a converter */
+	        return(-1);
+	    }
+	}
+	if (in->buf->rawconsumed < unused)
+	    return(-1);
+	return(in->buf->rawconsumed - unused);
+    }
+    return(in->consumed + (in->cur - in->base));
+}
+
 #ifndef LIBXML_ICONV_ENABLED
 #ifdef LIBXML_ISO8859X_ENABLED
 
diff --git a/include/libxml/encoding.h b/include/libxml/encoding.h
index 7b7d4ec..76c5bbc 100644
--- a/include/libxml/encoding.h
+++ b/include/libxml/encoding.h
@@ -115,7 +115,7 @@
  *     if the transcoding failed.
  * The value of @inlen after return is the number of octets consumed
  *     if the return value is positive, else unpredictiable.
- * The value of @outlen after return is the number of ocetes consumed.
+ * The value of @outlen after return is the number of octets produced.
  */
 typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
                                           const unsigned char *in, int *inlen);
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 88d5ee6..2cecb20 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -1019,6 +1019,13 @@
 		xmlLoadExternalEntity	(const char *URL,
 					 const char *ID,
 					 xmlParserCtxtPtr ctxt);
+
+/*
+ * Index lookup, actually implemented in the encoding module
+ */
+XMLPUBFUN long XMLCALL
+		xmlByteConsumed		(xmlParserCtxtPtr ctxt);
+
 /*
  * New set of simpler/more flexible APIs
  */
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index 2ab845d..58a7bb6 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -133,6 +133,7 @@
     xmlBufferPtr raw;       /* if encoder != NULL buffer for raw input */
     int	compressed;	    /* -1=unknown, 0=not compressed, 1=compressed */
     int error;
+    unsigned long rawconsumed;/* amount consumed from raw */
 };
 
 
diff --git a/parserInternals.c b/parserInternals.c
index b6601d3..d03e3d4 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -1110,6 +1110,7 @@
          */
         if ((input->buf->buffer != NULL) && (input->buf->buffer->use > 0)) {
             int processed;
+	    unsigned int use;
 
             /*
              * Specific handling of the Byte Order Mark for 
@@ -1145,6 +1146,8 @@
             xmlBufferShrink(input->buf->buffer, processed);
             input->buf->raw = input->buf->buffer;
             input->buf->buffer = xmlBufferCreate();
+	    input->buf->rawconsumed = processed;
+	    use = input->buf->raw->use;
 
             if (ctxt->html) {
                 /*
@@ -1170,6 +1173,7 @@
                                NULL);
                 return (-1);
             }
+	    input->buf->rawconsumed += use - input->buf->raw->use;
             input->base = input->cur = input->buf->buffer->content;
             input->end = &input->base[input->buf->buffer->use];
 
diff --git a/python/libxml2class.txt b/python/libxml2class.txt
index 5441455..1df6037 100644
--- a/python/libxml2class.txt
+++ b/python/libxml2class.txt
@@ -894,6 +894,7 @@
     htmlParseElement()
 
     # functions from module parser
+    byteConsumed()
     clearParserCtxt()
     ctxtReadDoc()
     ctxtReadFd()
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
index c496dc8..a07497e 100644
--- a/python/tests/Makefile.am
+++ b/python/tests/Makefile.am
@@ -32,7 +32,8 @@
     readererr.py\
     relaxng.py	\
     thread2.py \
-    tstLastError.py
+    tstLastError.py \
+    indexes.py
 
 XMLS=		\
     tst.xml	\
diff --git a/python/tests/indexes.py b/python/tests/indexes.py
new file mode 100755
index 0000000..18c85c7
--- /dev/null
+++ b/python/tests/indexes.py
@@ -0,0 +1,112 @@
+#!/usr/bin/python -u
+import sys
+import libxml2
+
+# Memory debug specific
+libxml2.debugMemory(1)
+
+ctxt = None
+
+class callback:
+    def __init__(self, startd, starte, ende, delta, endd):
+        self.startd = startd
+        self.starte = starte
+        self.ende = ende
+        self.endd = endd
+	self.delta = delta
+	self.count = 0
+
+    def startDocument(self):
+        global ctxt
+	if ctxt.byteConsumed() != self.startd:
+	    print "document start at wrong index: %d expecting %d\n" % (
+	          ctxt.byteConsumed(), self.startd)
+            sys.exit(1)
+
+    def endDocument(self):
+        global ctxt
+	expect = self.ende + self.delta * (self.count - 1) + self.endd
+	if ctxt.byteConsumed() != expect:
+	    print "document end at wrong index: %d expecting %d\n" % (
+	          ctxt.byteConsumed(), expect)
+            sys.exit(1)
+
+    def startElement(self, tag, attrs):
+        global ctxt
+	if tag == "bar1":
+	    expect = self.starte + self.delta * self.count
+	    if ctxt.byteConsumed() != expect:
+		print "element start at wrong index: %d expecting %d\n" % (
+		      ctxt.byteConsumed(), expect)
+		sys.exit(1)
+	    
+
+    def endElement(self, tag):
+        global ctxt
+	if tag == "bar1":
+	    expect = self.ende + self.delta * self.count
+	    if ctxt.byteConsumed() != expect:
+		print "element end at wrong index: %d expecting %d\n" % (
+		      ctxt.byteConsumed(), expect)
+		sys.exit(1)
+	    self.count = self.count + 1
+
+    def characters(self, data):
+        pass
+
+#
+# First run a pure UTF-8 test
+#
+handler = callback(0, 13, 27, 198, 183)
+ctxt = libxml2.createPushParser(handler, "<foo>\n", 6, "test.xml")
+chunk = """  <bar1>chars1</bar1>
+  <bar2>chars2</bar2>
+  <bar3>chars3</bar3>
+  <bar4>chars4</bar4>
+  <bar5>chars5</bar5>
+  <bar6>&lt;s6</bar6>
+  <bar7>chars7</bar7>
+  <bar8>&#38;8</bar8>
+  <bar9>chars9</bar9>
+"""
+i = 0
+while i < 10000:
+    ctxt.parseChunk(chunk, len(chunk), 0)
+    i = i + 1
+chunk = "</foo>"
+ctxt.parseChunk(chunk, len(chunk), 1)
+ctxt=None
+
+#
+# Then run a test relying on ISO-Latin-1
+#
+handler = callback(43, 57, 71, 198, 183)
+chunk="""<?xml version="1.0" encoding="ISO-8859-1"?>
+<foo>
+"""
+ctxt = libxml2.createPushParser(handler, chunk, len(chunk), "test.xml")
+chunk = """  <bar1>chars1</bar1>
+  <bar2>chars2</bar2>
+  <bar3>chars3</bar3>
+  <bar4>chàrs4</bar4>
+  <bar5>chars5</bar5>
+  <bar6>&lt;s6</bar6>
+  <bar7>chars7</bar7>
+  <bar8>&#38;8</bar8>
+  <bar9>très 9</bar9>
+"""
+i = 0
+while i < 10000:
+    ctxt.parseChunk(chunk, len(chunk), 0)
+    i = i + 1
+chunk = "</foo>"
+ctxt.parseChunk(chunk, len(chunk), 1)
+ctxt=None
+
+# Memory debug specific
+libxml2.cleanupParser()
+if libxml2.debugMemory(1) == 0:
+    print "OK"
+else:
+    print "Memory leak %d bytes" % (libxml2.debugMemory(1))
+    libxml2.dumpMemory()
diff --git a/rngparser.c b/rngparser.c
index bc72f6b..bfc9394 100644
--- a/rngparser.c
+++ b/rngparser.c
@@ -1438,13 +1438,13 @@
     xmlDocPtr ret = NULL;
 
     if (schemas == NULL) return(NULL);
-    if (len <= 5) len = xmlStrlen(schemas);
+    if (len <= 5) len = xmlStrlen((const unsigned char *) schemas);
     if (len <= 0) return(NULL);
 
     memset(&ctxt, 0, sizeof(ctxt));
-    ctxt.compact = schemas;
-    ctxt.cur = schemas;
-    ctxt.end = &schemas[len];
+    ctxt.compact = (const unsigned char *) schemas;
+    ctxt.cur = (const unsigned char *) schemas;
+    ctxt.end = (const unsigned char *) &schemas[len];
     ctxt.dict = xmlDictCreate();
     if (ctxt.dict == NULL)
         return(NULL);
diff --git a/tree.c b/tree.c
index 5a6c9df..8b8eedb 100644
--- a/tree.c
+++ b/tree.c
@@ -8320,7 +8320,6 @@
 		int * doc_txt_len, const char * txt_encoding,
 		int format) {
     int                         dummy = 0;
-
     xmlOutputBufferPtr          out_buff = NULL;
     xmlCharEncodingHandlerPtr   conv_hdlr = NULL;
 
@@ -8349,13 +8348,13 @@
     if (txt_encoding == NULL)
 	txt_encoding = (const char *) out_doc->encoding;
     if (txt_encoding != NULL) {
-		conv_hdlr = xmlFindCharEncodingHandler(txt_encoding);
-            if ( conv_hdlr == NULL ) {
-		xmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, (xmlNodePtr) out_doc,
-		           txt_encoding);
-                return;
-            }
-        }
+	conv_hdlr = xmlFindCharEncodingHandler(txt_encoding);
+	if ( conv_hdlr == NULL ) {
+	    xmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, (xmlNodePtr) out_doc,
+		       txt_encoding);
+	    return;
+	}
+    }
 
     if ((out_buff = xmlAllocOutputBuffer(conv_hdlr)) == NULL ) {
         xmlSaveErrMemory("creating buffer");
diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src
index 9cdde6f..88de819 100644
--- a/win32/libxml2.def.src
+++ b/win32/libxml2.def.src
@@ -483,6 +483,7 @@
 xmlAddSibling
 xmlAllocOutputBuffer
 xmlAllocParserInputBuffer
+xmlAttrSerializeTxtContent
 #ifdef LIBXML_AUTOMATA_ENABLED
 xmlAutomataCompile
 #endif
@@ -549,6 +550,7 @@
 xmlBufferWriteQuotedString
 xmlBuildQName
 xmlBuildURI
+xmlByteConsumed
 #ifdef LIBXML_C14N_ENABLED
 xmlC14NDocDumpMemory
 #endif
@@ -723,6 +725,7 @@
 xmlDeregisterNodeDefault
 xmlDetectCharEncoding
 xmlDictCreate
+xmlDictCreateSub
 xmlDictFree
 xmlDictLookup
 xmlDictOwns
@@ -1389,6 +1392,9 @@
 #ifdef LIBXML_SCHEMAS_ENABLED
 xmlRelaxNGValidatePushElement
 #endif
+#ifdef LIBXML_SCHEMAS_ENABLED
+xmlRelaxParserSetFlag
+#endif
 xmlRemoveID
 xmlRemoveProp
 xmlRemoveRef
@@ -1679,6 +1685,7 @@
 #endif
 xmlTextReaderSetErrorHandler
 xmlTextReaderSetParserProp
+xmlTextReaderSetStructuredErrorHandler
 xmlTextReaderValue
 xmlTextReaderXmlLang
 xmlTextWriterEndAttribute
@@ -2415,6 +2422,9 @@
 xmlXPathCountFunction
 #endif
 #ifdef LIBXML_XPATH_ENABLED
+xmlXPathCtxtCompile
+#endif
+#ifdef LIBXML_XPATH_ENABLED
 #ifdef LIBXML_DEBUG_ENABLED
 xmlXPathDebugDumpCompExpr
 #endif
diff --git a/xmlIO.c b/xmlIO.c
index 02c5ec9..0225aa0 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -1978,6 +1978,7 @@
     ret->closecallback = NULL;
     ret->context = NULL;
     ret->compressed = -1;
+    ret->rawconsumed = 0;
 
     return(ret);
 }
@@ -2567,6 +2568,8 @@
     if (len < 0) return(0);
     if ((in == NULL) || (in->error)) return(-1);
     if (in->encoder != NULL) {
+        unsigned int use;
+
         /*
 	 * Store the data in the incoming raw buffer
 	 */
@@ -2578,12 +2581,14 @@
 	/*
 	 * convert as much as possible to the parser reading buffer.
 	 */
+	use = in->raw->use;
 	nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw);
 	if (nbchars < 0) {
 	    xmlIOErr(XML_IO_ENCODER, NULL);
 	    in->error = XML_IO_ENCODER;
 	    return(-1);
 	}
+	in->rawconsumed += (use - in->raw->use);
     } else {
 	nbchars = len;
         xmlBufferAdd(in->buffer, (xmlChar *) buf, nbchars);
@@ -2670,6 +2675,8 @@
     }
     len = res;
     if (in->encoder != NULL) {
+        unsigned int use;
+
         /*
 	 * Store the data in the incoming raw buffer
 	 */
@@ -2681,12 +2688,14 @@
 	/*
 	 * convert as much as possible to the parser reading buffer.
 	 */
+	use = in->raw->use;
 	nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw);
 	if (nbchars < 0) {
 	    xmlIOErr(XML_IO_ENCODER, NULL);
 	    in->error = XML_IO_ENCODER;
 	    return(-1);
 	}
+	in->rawconsumed += (use - in->raw->use);
     } else {
 	nbchars = len;
     	in->buffer->use += nbchars;