preparing libxml2-2.6.0 updated and regenerated the docs and API moved the

* configure.in NEWS doc/libxml2.xsa: preparing libxml2-2.6.0
* doc/*: updated and regenerated the docs and API
* SAX2.c error.c tree.c: moved the line number to their proper
  field in elements now.
Daniel
diff --git a/ChangeLog b/ChangeLog
index 34056a6..8504af4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Oct 21 02:03:03 CEST 2003 Daniel Veillard <daniel@veillard.com>
+
+	* configure.in NEWS doc/libxml2.xsa: preparing libxml2-2.6.0
+	* doc/*: updated and regenerated the docs and API
+
+Tue Oct 21 01:01:55 CEST 2003 Daniel Veillard <daniel@veillard.com>
+
+	* SAX2.c error.c tree.c: moved the line number to their proper
+	  field in elements now.
+
 Tue Oct 21 00:28:20 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
 	* configure.in xmlwriter.c Makefile.am include/libxml/xmlwriter.h
diff --git a/NEWS b/NEWS
index 992142a..3b57c12 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,73 @@
   Schemas
 
 
+2.6.0: Oct 20 2003:
+   - Major revision release: should be API and ABI compatible but got a lot
+    of change
+   - Increased the library modularity, far more options can be stripped out,
+    a --with-minimum configuration will weight around 160KBytes
+   - Use per parser and per document dictionnary, allocate names and small
+    text nodes from the dictionnary
+   - Switch to a SAX2 like parser rewrote most of the XML parser core,
+    provides namespace resolution and defaulted attributes, minimize memory
+    allocations and copies, namespace checking and specific error handling,
+    immutable buffers, make predefined entities static structures, etc...
+   - rewrote all the error handling in the library, all errors can be
+    intercepted at a structured level, with precise information
+  available.
+   - New simpler and more generic XML and HTML parser APIs, allowing to
+    easilly modify the parsing options and reuse parser context for multiple
+    consecutive documents.
+   - Similar new APIs for the xmlReader, for options and reuse, provided new
+    functions to access content as const strings, use them for Python
+  bindings
+   - a  lot of other smaller API improvements: xmlStrPrintf (Aleksey Sanin),
+    Walker i.e. reader on a document tree based on Alfred Mickautsch code,
+    make room in nodes for line numbers, reference counting and future PSVI
+    extensions, generation of character ranges to be checked with faster
+    algorithm (William),  xmlParserMaxDepth (Crutcher Dunnavant), buffer
+    access
+   - New xmlWriter API provided by Alfred Mickautsch
+   - Schemas: base64 support by Anthony Carrico
+   - Parser<->HTTP integration fix, proper processing of the Mime-Type
+    and charset informations if available.
+   - Relax-NG: bug fixes including the one reported by Martijn Faassen and
+    zeroOrMore, better error reporting.
+   - Python bindings (Stéphane Bidoul), never use stdout for errors
+  output
+   - Portability: all the headers have macros for export and calling
+    convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry),
+    Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher,  Igor),
+    Mingw (Igor), typos (Mark Vakoc),  beta version (Stephane Bidoul),
+    warning cleanups on AIX and MIPS compilers (William Brack), BeOS (Marcin
+    'Shard' Konicki)
+   - Documentation fixes and README (William Brack), search fix (William),
+    tutorial updates (John Fleck), namespace docs (Stefan Kost)
+   - Bug fixes: xmlCleanupParser (Dave Beckett), threading uninitialized
+    mutexes, HTML doctype lowercase,  SAX/IO (William), compression detection
+    and restore (William), attribute declaration in DTDs (William), namespace
+    on attribute in HTML output (William), input filename (Rob Richards),
+    namespace DTD validation, xmlReplaceNode (Chris Ryland), I/O callbacks
+    (Markus Keim), CDATA serialization (Shaun McCance), xmlReader (Peter
+    Derr), high codepoint charref like &#x10FFFF;, buffer access in push
+    mode (Justin Fletcher), TLS threads on Windows (Jesse Pelton), XPath bug
+    (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
+    error handling.
+   - xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
+    testing,  --nodict for building without tree dictionnary, --nocdata to
+    replace CDATA by text, --nsclean to remove surperfluous  namespace
+    declarations
+   - added xml2-config --libtool-libs option from Kevin P. Fleming
+   - a lot of profiling and tuning of the code, speedup patch for
+    xmlSearchNs() by Luca Padovani. The xmlReader should do far less
+    allocation and it speed should get closer to SAX. Chris Anderson worked
+    on speeding and cleaning up repetitive checking code.
+   - cleanup of "make tests"
+   - libxml-2.0-uninstalled.pc from Malcolm Tredinnick
+   - deactivated the broken docBook SGML parser code and plugged the XML
+    parser instead.
+
+
 2.5.11: Sep 9 2003:
 A bugfix only release:   - risk of crash in Relax-NG
    - risk of crash when using multithreaded programs
diff --git a/SAX2.c b/SAX2.c
index 3c64ac2..1841e50 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -1410,8 +1410,12 @@
     }
     ctxt->nodemem = -1;
     if (ctxt->linenumbers) {
-	if (ctxt->input != NULL)
-	    ret->content = (void *) (long) ctxt->input->line;
+	if (ctxt->input != NULL) {
+	    if (ctxt->input->line < 65535)
+		ret->line = (short) ctxt->input->line;
+	    else
+	        ret->line = 65535;
+	}
     }
 
     /*
@@ -1983,8 +1987,12 @@
 	}
     }
     if (ctxt->linenumbers) {
-	if (ctxt->input != NULL)
-	    ret->content = (void *) (long) ctxt->input->line;
+	if (ctxt->input != NULL) {
+	    if (ctxt->input->line < 65535)
+		ret->line = (short) ctxt->input->line;
+	    else
+	        ret->line = 65535;
+	}
     }
 
     if (ctxt->myDoc->children == NULL) {
diff --git a/configure.in b/configure.in
index e5e7237..24a93ab 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@
 LIBXML_MAJOR_VERSION=2
 LIBXML_MINOR_VERSION=6
 LIBXML_MICRO_VERSION=0
-LIBXML_MICRO_VERSION_SUFFIX=beta6
+LIBXML_MICRO_VERSION_SUFFIX=
 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
 
diff --git a/doc/libxml2.xsa b/doc/libxml2.xsa
index 93834bf..abc669c 100644
--- a/doc/libxml2.xsa
+++ b/doc/libxml2.xsa
@@ -8,9 +8,74 @@
   </vendor>
   <product id="libxml2">
     <name>libxml2</name>
-    <version>2.5.11</version>
-    <last-release> Sep 9 2003</last-release>
+    <version>2.6.0</version>
+    <last-release> Oct 20 2003</last-release>
     <info-url>http://xmlsoft.org/</info-url>
-    <changes>A bugfix only release:</changes>
+    <changes>   - Major revision release: should be API and ABI compatible but got a lot
+    of change
+   - Increased the library modularity, far more options can be stripped out,
+    a --with-minimum configuration will weight around 160KBytes
+   - Use per parser and per document dictionnary, allocate names and small
+    text nodes from the dictionnary
+   - Switch to a SAX2 like parser rewrote most of the XML parser core,
+    provides namespace resolution and defaulted attributes, minimize memory
+    allocations and copies, namespace checking and specific error handling,
+    immutable buffers, make predefined entities static structures, etc...
+   - rewrote all the error handling in the library, all errors can be
+    intercepted at a structured level, with precise information
+  available.
+   - New simpler and more generic XML and HTML parser APIs, allowing to
+    easilly modify the parsing options and reuse parser context for multiple
+    consecutive documents.
+   - Similar new APIs for the xmlReader, for options and reuse, provided new
+    functions to access content as const strings, use them for Python
+  bindings
+   - a  lot of other smaller API improvements: xmlStrPrintf (Aleksey Sanin),
+    Walker i.e. reader on a document tree based on Alfred Mickautsch code,
+    make room in nodes for line numbers, reference counting and future PSVI
+    extensions, generation of character ranges to be checked with faster
+    algorithm (William),  xmlParserMaxDepth (Crutcher Dunnavant), buffer
+    access
+   - New xmlWriter API provided by Alfred Mickautsch
+   - Schemas: base64 support by Anthony Carrico
+   - Parser&lt;-&gt;HTTP integration fix, proper processing of the Mime-Type
+    and charset informations if available.
+   - Relax-NG: bug fixes including the one reported by Martijn Faassen and
+    zeroOrMore, better error reporting.
+   - Python bindings (St&#xE9;phane Bidoul), never use stdout for errors
+  output
+   - Portability: all the headers have macros for export and calling
+    convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry),
+    Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher,  Igor),
+    Mingw (Igor), typos (Mark Vakoc),  beta version (Stephane Bidoul),
+    warning cleanups on AIX and MIPS compilers (William Brack), BeOS (Marcin
+    'Shard' Konicki)
+   - Documentation fixes and README (William Brack), search fix (William),
+    tutorial updates (John Fleck), namespace docs (Stefan Kost)
+   - Bug fixes: xmlCleanupParser (Dave Beckett), threading uninitialized
+    mutexes, HTML doctype lowercase,  SAX/IO (William), compression detection
+    and restore (William), attribute declaration in DTDs (William), namespace
+    on attribute in HTML output (William), input filename (Rob Richards),
+    namespace DTD validation, xmlReplaceNode (Chris Ryland), I/O callbacks
+    (Markus Keim), CDATA serialization (Shaun McCance), xmlReader (Peter
+    Derr), high codepoint charref like &amp;#x10FFFF;, buffer access in push
+    mode (Justin Fletcher), TLS threads on Windows (Jesse Pelton), XPath bug
+    (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
+    error handling.
+   - xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
+    testing,  --nodict for building without tree dictionnary, --nocdata to
+    replace CDATA by text, --nsclean to remove surperfluous  namespace
+    declarations
+   - added xml2-config --libtool-libs option from Kevin P. Fleming
+   - a lot of profiling and tuning of the code, speedup patch for
+    xmlSearchNs() by Luca Padovani. The xmlReader should do far less
+    allocation and it speed should get closer to SAX. Chris Anderson worked
+    on speeding and cleaning up repetitive checking code.
+   - cleanup of "make tests"
+   - libxml-2.0-uninstalled.pc from Malcolm Tredinnick
+   - deactivated the broken docBook SGML parser code and plugged the XML
+    parser instead.
+
+</changes>
   </product>
 </xsa>
diff --git a/doc/namespaces.html b/doc/namespaces.html
index 6f15c5f..37f28e1 100644
--- a/doc/namespaces.html
+++ b/doc/namespaces.html
@@ -34,21 +34,17 @@
 associated with the element or the attribute, not the prefix string (which is
 just a shortcut for the full URI). In libxml, element and attributes have an
 <code>ns</code> field pointing to an xmlNs structure detailing the namespace
-prefix and its URI.</p><p>@@Interfaces@@</p><pre>
-xmlNodePtr node;
+prefix and its URI.</p><p>@@Interfaces@@</p><pre>xmlNodePtr node;
 if(!strncmp(node-&gt;name,&quot;mytag&quot;,5)
   &amp;&amp; node-&gt;ns
   &amp;&amp; !strcmp(node-&gt;ns-&gt;href,&quot;http://www.mysite.com/myns/1.0&quot;)) {
   ...
-}
-</pre><p>Usually people object to using namespaces together with validity checking.
+}</pre><p>Usually people object to using namespaces together with validity checking.
 I will try to make sure that using namespaces won't break validity checking,
 so even if you plan to use or currently are using validation I strongly
 suggest adding namespaces to your document. A default namespace scheme
 <code>xmlns=&quot;http://....&quot;</code> should not break validity even on less
 flexible parsers. Using namespaces to mix and differentiate content coming
-from multiple DTDs will certainly break current validation schemes.
-To check such documents one needs to use schema-validation, which is supported
-in libxml2 as well. See <a href="http://www.relaxng.org/">relagx-ng</a> and
-<a href="http://www.w3c.org/XML/Schema">w3c-schema</a>.
-</p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+from multiple DTDs will certainly break current validation schemes. To check
+such documents one needs to use schema-validation, which is supported in
+libxml2 as well. See <a href="http://www.relaxng.org/">relagx-ng</a> and <a href="http://www.w3c.org/XML/Schema">w3c-schema</a>.</p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
diff --git a/doc/news.html b/doc/news.html
index a3b56fd..ce9367a 100644
--- a/doc/news.html
+++ b/doc/news.html
@@ -12,6 +12,70 @@
 to test those</p><ul><li>More testing on RelaxNG</li>
   <li>Finishing up <a href="http://www.w3.org/TR/xmlschema-1/">XML
   Schemas</a></li>
+</ul><h3>2.6.0: Oct 20 2003</h3><ul><li>Major revision release: should be API and ABI compatible but got a lot
+    of change</li>
+  <li>Increased the library modularity, far more options can be stripped out,
+    a --with-minimum configuration will weight around 160KBytes</li>
+  <li>Use per parser and per document dictionnary, allocate names and small
+    text nodes from the dictionnary</li>
+  <li>Switch to a SAX2 like parser rewrote most of the XML parser core,
+    provides namespace resolution and defaulted attributes, minimize memory
+    allocations and copies, namespace checking and specific error handling,
+    immutable buffers, make predefined entities static structures, etc...</li>
+  <li>rewrote all the error handling in the library, all errors can be
+    intercepted at a structured level, with precise information
+  available.</li>
+  <li>New simpler and more generic XML and HTML parser APIs, allowing to
+    easilly modify the parsing options and reuse parser context for multiple
+    consecutive documents.</li>
+  <li>Similar new APIs for the xmlReader, for options and reuse, provided new
+    functions to access content as const strings, use them for Python
+  bindings</li>
+  <li>a  lot of other smaller API improvements: xmlStrPrintf (Aleksey Sanin),
+    Walker i.e. reader on a document tree based on Alfred Mickautsch code,
+    make room in nodes for line numbers, reference counting and future PSVI
+    extensions, generation of character ranges to be checked with faster
+    algorithm (William),  xmlParserMaxDepth (Crutcher Dunnavant), buffer
+    access</li>
+  <li>New xmlWriter API provided by Alfred Mickautsch</li>
+  <li>Schemas: base64 support by Anthony Carrico</li>
+  <li>Parser&lt;-&gt;HTTP integration fix, proper processing of the Mime-Type
+    and charset informations if available.</li>
+  <li>Relax-NG: bug fixes including the one reported by Martijn Faassen and
+    zeroOrMore, better error reporting.</li>
+  <li>Python bindings (Stéphane Bidoul), never use stdout for errors
+  output</li>
+  <li>Portability: all the headers have macros for export and calling
+    convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry),
+    Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher,  Igor),
+    Mingw (Igor), typos (Mark Vakoc),  beta version (Stephane Bidoul),
+    warning cleanups on AIX and MIPS compilers (William Brack), BeOS (Marcin
+    'Shard' Konicki)</li>
+  <li>Documentation fixes and README (William Brack), search fix (William),
+    tutorial updates (John Fleck), namespace docs (Stefan Kost)</li>
+  <li>Bug fixes: xmlCleanupParser (Dave Beckett), threading uninitialized
+    mutexes, HTML doctype lowercase,  SAX/IO (William), compression detection
+    and restore (William), attribute declaration in DTDs (William), namespace
+    on attribute in HTML output (William), input filename (Rob Richards),
+    namespace DTD validation, xmlReplaceNode (Chris Ryland), I/O callbacks
+    (Markus Keim), CDATA serialization (Shaun McCance), xmlReader (Peter
+    Derr), high codepoint charref like &amp;#x10FFFF;, buffer access in push
+    mode (Justin Fletcher), TLS threads on Windows (Jesse Pelton), XPath bug
+    (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
+    error handling.</li>
+  <li>xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
+    testing,  --nodict for building without tree dictionnary, --nocdata to
+    replace CDATA by text, --nsclean to remove surperfluous  namespace
+    declarations</li>
+  <li>added xml2-config --libtool-libs option from Kevin P. Fleming</li>
+  <li>a lot of profiling and tuning of the code, speedup patch for
+    xmlSearchNs() by Luca Padovani. The xmlReader should do far less
+    allocation and it speed should get closer to SAX. Chris Anderson worked
+    on speeding and cleaning up repetitive checking code.</li>
+  <li>cleanup of &quot;make tests&quot;</li>
+  <li>libxml-2.0-uninstalled.pc from Malcolm Tredinnick</li>
+  <li>deactivated the broken docBook SGML parser code and plugged the XML
+    parser instead.</li>
 </ul><h3>2.5.11: Sep 9 2003</h3><p>A bugfix only release:</p><ul><li>risk of crash in Relax-NG</li>
   <li>risk of crash when using multithreaded programs</li>
 </ul><h3>2.5.10: Aug 15 2003</h3><p>A bugfixes only release</p><ul><li>Windows Makefiles (William Brack)</li>
diff --git a/doc/xml.html b/doc/xml.html
index f7fcdaa..07b545f 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -661,6 +661,74 @@
   Schemas</a></li>
 </ul>
 
+<h3>2.6.0: Oct 20 2003</h3>
+<ul>
+  <li>Major revision release: should be API and ABI compatible but got a lot
+    of change</li>
+  <li>Increased the library modularity, far more options can be stripped out,
+    a --with-minimum configuration will weight around 160KBytes</li>
+  <li>Use per parser and per document dictionnary, allocate names and small
+    text nodes from the dictionnary</li>
+  <li>Switch to a SAX2 like parser rewrote most of the XML parser core,
+    provides namespace resolution and defaulted attributes, minimize memory
+    allocations and copies, namespace checking and specific error handling,
+    immutable buffers, make predefined entities static structures, etc...</li>
+  <li>rewrote all the error handling in the library, all errors can be
+    intercepted at a structured level, with precise information
+  available.</li>
+  <li>New simpler and more generic XML and HTML parser APIs, allowing to
+    easilly modify the parsing options and reuse parser context for multiple
+    consecutive documents.</li>
+  <li>Similar new APIs for the xmlReader, for options and reuse, provided new
+    functions to access content as const strings, use them for Python
+  bindings</li>
+  <li>a  lot of other smaller API improvements: xmlStrPrintf (Aleksey Sanin),
+    Walker i.e. reader on a document tree based on Alfred Mickautsch code,
+    make room in nodes for line numbers, reference counting and future PSVI
+    extensions, generation of character ranges to be checked with faster
+    algorithm (William),  xmlParserMaxDepth (Crutcher Dunnavant), buffer
+    access</li>
+  <li>New xmlWriter API provided by Alfred Mickautsch</li>
+  <li>Schemas: base64 support by Anthony Carrico</li>
+  <li>Parser&lt;-&gt;HTTP integration fix, proper processing of the Mime-Type
+    and charset informations if available.</li>
+  <li>Relax-NG: bug fixes including the one reported by Martijn Faassen and
+    zeroOrMore, better error reporting.</li>
+  <li>Python bindings (Stéphane Bidoul), never use stdout for errors
+  output</li>
+  <li>Portability: all the headers have macros for export and calling
+    convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry),
+    Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher,  Igor),
+    Mingw (Igor), typos (Mark Vakoc),  beta version (Stephane Bidoul),
+    warning cleanups on AIX and MIPS compilers (William Brack), BeOS (Marcin
+    'Shard' Konicki)</li>
+  <li>Documentation fixes and README (William Brack), search fix (William),
+    tutorial updates (John Fleck), namespace docs (Stefan Kost)</li>
+  <li>Bug fixes: xmlCleanupParser (Dave Beckett), threading uninitialized
+    mutexes, HTML doctype lowercase,  SAX/IO (William), compression detection
+    and restore (William), attribute declaration in DTDs (William), namespace
+    on attribute in HTML output (William), input filename (Rob Richards),
+    namespace DTD validation, xmlReplaceNode (Chris Ryland), I/O callbacks
+    (Markus Keim), CDATA serialization (Shaun McCance), xmlReader (Peter
+    Derr), high codepoint charref like &amp;#x10FFFF;, buffer access in push
+    mode (Justin Fletcher), TLS threads on Windows (Jesse Pelton), XPath bug
+    (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
+    error handling.</li>
+  <li>xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
+    testing,  --nodict for building without tree dictionnary, --nocdata to
+    replace CDATA by text, --nsclean to remove surperfluous  namespace
+    declarations</li>
+  <li>added xml2-config --libtool-libs option from Kevin P. Fleming</li>
+  <li>a lot of profiling and tuning of the code, speedup patch for
+    xmlSearchNs() by Luca Padovani. The xmlReader should do far less
+    allocation and it speed should get closer to SAX. Chris Anderson worked
+    on speeding and cleaning up repetitive checking code.</li>
+  <li>cleanup of "make tests"</li>
+  <li>libxml-2.0-uninstalled.pc from Malcolm Tredinnick</li>
+  <li>deactivated the broken docBook SGML parser code and plugged the XML
+    parser instead.</li>
+</ul>
+
 <h3>2.5.11: Sep 9 2003</h3>
 
 <p>A bugfix only release:</p>
@@ -3757,15 +3825,12 @@
 prefix and its URI.</p>
 
 <p>@@Interfaces@@</p>
-
-<pre>
-xmlNodePtr node;
+<pre>xmlNodePtr node;
 if(!strncmp(node-&gt;name,"mytag",5)
   &amp;&amp; node-&gt;ns
   &amp;&amp; !strcmp(node-&gt;ns-&gt;href,"http://www.mysite.com/myns/1.0")) {
   ...
-}
-</pre>
+}</pre>
 
 <p>Usually people object to using namespaces together with validity checking.
 I will try to make sure that using namespaces won't break validity checking,
@@ -3773,11 +3838,10 @@
 suggest adding namespaces to your document. A default namespace scheme
 <code>xmlns="http://...."</code> should not break validity even on less
 flexible parsers. Using namespaces to mix and differentiate content coming
-from multiple DTDs will certainly break current validation schemes.
-To check such documents one needs to use schema-validation, which is supported
-in libxml2 as well. See <a href="http://www.relaxng.org/">relagx-ng</a> and
-<a href="http://www.w3c.org/XML/Schema">w3c-schema</a>.
-</p>
+from multiple DTDs will certainly break current validation schemes. To check
+such documents one needs to use schema-validation, which is supported in
+libxml2 as well. See <a href="http://www.relaxng.org/">relagx-ng</a> and <a
+href="http://www.w3c.org/XML/Schema">w3c-schema</a>.</p>
 
 <h2><a name="Upgrading">Upgrading 1.x code</a></h2>
 
diff --git a/error.c b/error.c
index e450f1f..acf7ff3 100644
--- a/error.c
+++ b/error.c
@@ -495,7 +495,7 @@
 	    base = xmlStrdup(node->doc->URL);
 
 	if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
-	    line = (int) node->content;
+	    line = node->line;
     }
 
     /*
diff --git a/tree.c b/tree.c
index 1c327e6..bca13e7 100644
--- a/tree.c
+++ b/tree.c
@@ -3748,7 +3748,7 @@
 	ret->content = xmlStrdup(node->content);
     }else{
       if (node->type == XML_ELEMENT_NODE)
-        ret->content = (void*)(long) node->content;
+        ret->line = node->line;
     }
     if (parent != NULL) {
 	xmlNodePtr tmp;
@@ -4071,7 +4071,7 @@
     if (!node)
         return result;
     if (node->type == XML_ELEMENT_NODE)
-        result = (long) node->content;
+        result = (long) node->line;
     else if ((node->prev != NULL) &&
              ((node->prev->type == XML_ELEMENT_NODE) ||
 	      (node->prev->type == XML_TEXT_NODE)))