Daniel Veillard | 09ab7e1 | 2001-07-10 15:49:44 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 2 | "http://www.w3.org/TR/html4/loose.dtd"> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 3 | <html> |
| 4 | <head> |
Daniel Veillard | 598bec3 | 2003-07-06 10:02:03 +0000 | [diff] [blame] | 5 | <title>The XML C parser and toolkit of Gnome</title> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 6 | <meta name="GENERATOR" content="amaya 8.8.5, see http://www.w3.org/Amaya/"> |
| 7 | <meta http-equiv="content-type" content="text/html"> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 8 | </head> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 9 | |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 10 | <body bgcolor="#ffffff"> |
Daniel Veillard | 598bec3 | 2003-07-06 10:02:03 +0000 | [diff] [blame] | 11 | <h1 align="center">The XML C parser and toolkit of Gnome</h1> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 12 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 13 | <h1>Note: this is the flat content of the <a |
| 14 | href="index.html">website</a></h1> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 15 | |
Daniel Veillard | c948420 | 2001-10-24 12:35:52 +0000 | [diff] [blame] | 16 | <h1 style="text-align: center">libxml, a.k.a. gnome-xml</h1> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 17 | |
| 18 | <p></p> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 19 | |
Daniel Veillard | 7ebac02 | 2004-02-25 22:36:35 +0000 | [diff] [blame] | 20 | <p |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 21 | style="text-align: right; font-style: italic; font-size: 10pt">"Programmingwith |
| 22 | libxml2 is like the thrilling embrace of an exotic stranger." <a |
| 23 | href="http://diveintomark.org/archives/2004/02/18/libxml2">MarkPilgrim</a></p> |
Daniel Veillard | 7ebac02 | 2004-02-25 22:36:35 +0000 | [diff] [blame] | 24 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 25 | <p>Libxml2 is the XML C parser and toolkit developed for the Gnome |
| 26 | project(but usable outside of the Gnome platform), it is free software |
| 27 | availableunder the <a |
| 28 | href="http://www.opensource.org/licenses/mit-license.html">MITLicense</a>. |
| 29 | XML itself is a metalanguage to design markup languages, i.e.text language |
| 30 | where semantic and structure are added to the content usingextra "markup" |
| 31 | information enclosed between angle brackets. HTML is the mostwell-known |
| 32 | markup language. Though the library is written in C <a href="python.html">a |
| 33 | variety of language bindings</a>make it available inother environments.</p> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 34 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 35 | <p>Libxml2 is known to be very portable, the library should build and |
| 36 | workwithout serious troubles on a variety of systems (Linux, Unix, |
| 37 | Windows,CygWin, MacOS, MacOS X, RISC Os, OS/2, VMS, QNX, MVS, ...)</p> |
Daniel Veillard | 710823b | 2003-03-04 10:05:52 +0000 | [diff] [blame] | 38 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 39 | <p>Libxml2 implements a number of existing standards related to |
| 40 | markuplanguages:</p> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 41 | <ul> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 42 | <li>the XML standard: <a |
| 43 | href="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</a></li> |
| 44 | <li>Namespaces in XML: <a |
| 45 | href="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</a></li> |
| 46 | <li>XML Base: <a |
| 47 | href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a></li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 48 | <li><a href="http://www.cis.ohio-state.edu/rfc/rfc2396.txt">RFC |
| 49 | 2396</a>:Uniform Resource Identifiers <a |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 50 | href="http://www.ietf.org/rfc/rfc2396.txt">http://www.ietf.org/rfc/rfc2396.txt</a></li> |
| 51 | <li>XML Path Language (XPath) 1.0: <a |
| 52 | href="http://www.w3.org/TR/xpath">http://www.w3.org/TR/xpath</a></li> |
| 53 | <li>HTML4 parser: <a |
| 54 | href="http://www.w3.org/TR/html401/">http://www.w3.org/TR/html401/</a></li> |
Daniel Veillard | 23a52c5 | 2003-08-18 10:01:18 +0000 | [diff] [blame] | 55 | <li>XML Pointer Language (XPointer) Version 1.0: <a |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 56 | href="http://www.w3.org/TR/xptr">http://www.w3.org/TR/xptr</a></li> |
| 57 | <li>XML Inclusions (XInclude) Version 1.0: <a |
| 58 | href="http://www.w3.org/TR/xinclude/">http://www.w3.org/TR/xinclude/</a></li> |
Daniel Veillard | 23a52c5 | 2003-08-18 10:01:18 +0000 | [diff] [blame] | 59 | <li>ISO-8859-x encodings, as well as <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 60 | href="http://www.cis.ohio-state.edu/rfc/rfc2044.txt">rfc2044</a>[UTF-8]and |
| 61 | <a |
| 62 | href="http://www.cis.ohio-state.edu/rfc/rfc2781.txt">rfc2781</a>[UTF-16] |
| 63 | Unicode encodings, and more if using iconv support</li> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 64 | <li>part of SGML Open Technical Resolution TR9401:1997</li> |
| 65 | <li>XML Catalogs Working Draft 06 August 2001: <a |
| 66 | href="http://www.oasis-open.org/committees/entity/spec-2001-08-06.html">http://www.oasis-open.org/committees/entity/spec-2001-08-06.html</a></li> |
Daniel Veillard | 5c39654 | 2002-03-15 07:57:50 +0000 | [diff] [blame] | 67 | <li>Canonical XML Version 1.0: <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 68 | href="http://www.w3.org/TR/xml-c14n">http://www.w3.org/TR/xml-c14n</a>and |
| 69 | the Exclusive XML Canonicalization CR draft <a |
Daniel Veillard | 2d347fa | 2002-03-17 10:34:11 +0000 | [diff] [blame] | 70 | href="http://www.w3.org/TR/xml-exc-c14n">http://www.w3.org/TR/xml-exc-c14n</a></li> |
Daniel Veillard | 758c531 | 2003-12-15 11:51:25 +0000 | [diff] [blame] | 71 | <li>Relax NG, ISO/IEC 19757-2:2003, <a |
Daniel Veillard | 17bed98 | 2003-02-24 20:11:43 +0000 | [diff] [blame] | 72 | href="http://www.oasis-open.org/committees/relax-ng/spec-20011203.html">http://www.oasis-open.org/committees/relax-ng/spec-20011203.html</a></li> |
Daniel Veillard | f83a2c7 | 2003-04-08 13:48:40 +0000 | [diff] [blame] | 73 | <li>W3C XML Schemas Part 2: Datatypes <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 74 | href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">REC 02 |
| 75 | May2001</a></li> |
| 76 | <li>W3C <a href="http://www.w3.org/TR/xml-id/">xml:id</a>Working Draft |
| 77 | 7April 2004</li> |
Daniel Veillard | 9698445 | 2000-08-31 13:50:12 +0000 | [diff] [blame] | 78 | </ul> |
| 79 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 80 | <p>In most cases libxml2 tries to implement the specifications in arelatively |
| 81 | strictly compliant way. As of release 2.4.16, libxml2 passed all1800+ tests |
| 82 | from the <a |
| 83 | href="http://www.oasis-open.org/committees/xml-conformance/">OASIS XML |
| 84 | TestsSuite</a>.</p> |
Daniel Veillard | 5b16f58 | 2002-02-20 11:38:46 +0000 | [diff] [blame] | 85 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 86 | <p>To some extent libxml2 provides support for the following |
| 87 | additionalspecifications but doesn't claim to implement them completely:</p> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 88 | <ul> |
| 89 | <li>Document Object Model (DOM) <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 90 | href="http://www.w3.org/TR/DOM-Level-2-Core/">http://www.w3.org/TR/DOM-Level-2-Core/</a>the |
| 91 | document model, but it doesn't implement the API itself, gdome2 doesthis |
| 92 | on top of libxml2</li> |
| 93 | <li><a href="http://www.cis.ohio-state.edu/rfc/rfc959.txt">RFC |
| 94 | 959</a>:libxml2 implements a basic FTP client code</li> |
| 95 | <li><a href="http://www.cis.ohio-state.edu/rfc/rfc1945.txt">RFC |
| 96 | 1945</a>:HTTP/1.0, again a basic HTTP client code</li> |
| 97 | <li>SAX: a SAX2 like interface and a minimal SAX1 implementation |
| 98 | compatiblewith early expat versions</li> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 99 | </ul> |
| 100 | |
Daniel Veillard | f83a2c7 | 2003-04-08 13:48:40 +0000 | [diff] [blame] | 101 | <p>A partial implementation of <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 102 | href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML Schemas Part1: |
| 103 | Structure</a>is being worked on but it would be far too early to make |
| 104 | anyconformance statement about it at the moment.</p> |
Daniel Veillard | e6d8e20 | 2002-05-02 06:11:10 +0000 | [diff] [blame] | 105 | |
Daniel Veillard | 9698445 | 2000-08-31 13:50:12 +0000 | [diff] [blame] | 106 | <p>Separate documents:</p> |
| 107 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 108 | <li><a href="http://xmlsoft.org/XSLT/">the libxslt page</a>providing |
| 109 | animplementation of XSLT 1.0 and common extensions like EXSLT |
| 110 | forlibxml2</li> |
| 111 | <li><a href="http://www.cs.unibo.it/~casarini/gdome2/">the gdome2 page</a>: |
| 112 | a standard DOM2 implementation for libxml2</li> |
| 113 | <li><a href="http://www.aleksey.com/xmlsec/">the XMLSec page</a>: |
| 114 | animplementation of <a href="http://www.w3.org/TR/xmldsig-core/">W3C |
| 115 | XMLDigital Signature</a>for libxml2</li> |
| 116 | <li>also check the related links section below for more related and |
| 117 | activeprojects.</li> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 118 | </ul> |
Daniel Veillard | 252004d | 2004-03-23 12:32:32 +0000 | [diff] [blame] | 119 | <!----------------<p>Results of the <a |
Daniel Veillard | 806cada | 2003-03-19 21:58:59 +0000 | [diff] [blame] | 120 | href="http://xmlbench.sourceforge.net/results/benchmark/index.html">xmlbench |
Daniel Veillard | 31ae462 | 2004-02-16 07:45:44 +0000 | [diff] [blame] | 121 | benchmark</a> on sourceforge February 2004 (smaller is better):</p> |
Daniel Veillard | d8da01c | 2003-03-24 15:58:23 +0000 | [diff] [blame] | 122 | |
Daniel Veillard | 31ae462 | 2004-02-16 07:45:44 +0000 | [diff] [blame] | 123 | <p align="center"><img src="benchmark.png" |
Daniel Veillard | d8da01c | 2003-03-24 15:58:23 +0000 | [diff] [blame] | 124 | alt="benchmark results for Expat Xerces libxml2 Oracle and Sun toolkits"></p> |
Daniel Veillard | cf80b78 | 2004-03-07 19:32:19 +0000 | [diff] [blame] | 125 | --------------> |
Daniel Veillard | 806cada | 2003-03-19 21:58:59 +0000 | [diff] [blame] | 126 | |
Daniel Veillard | e166254 | 2002-08-28 11:50:59 +0000 | [diff] [blame] | 127 | <p>Logo designed by <a href="mailto:liyanage@access.ch">Marc Liyanage</a>.</p> |
| 128 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 129 | <h2><a name="Introducti">Introduction</a></h2> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 130 | |
Daniel Veillard | f13e1ed | 2000-03-06 07:41:49 +0000 | [diff] [blame] | 131 | <p>This document describes libxml, the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 132 | href="http://www.w3.org/XML/">XML</a>C parser and toolkit developed for the<a |
| 133 | href="http://www.gnome.org/">Gnome</a>project. <a |
| 134 | href="http://www.w3.org/XML/">XML is a standard</a>for building |
| 135 | tag-basedstructured documents/data.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 136 | |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 137 | <p>Here are some key points about libxml:</p> |
| 138 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 139 | <li>Libxml2 exports Push (progressive) and Pull (blocking) type |
| 140 | parserinterfaces for both XML and HTML.</li> |
| 141 | <li>Libxml2 can do DTD validation at parse time, using a parsed |
| 142 | documentinstance, or with an arbitrary DTD.</li> |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 143 | <li>Libxml2 includes complete <a |
Daniel Veillard | 8c2ecaf | 2001-07-10 17:53:07 +0000 | [diff] [blame] | 144 | href="http://www.w3.org/TR/xpath">XPath</a>, <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 145 | href="http://www.w3.org/TR/xptr">XPointer</a>and <a |
| 146 | href="http://www.w3.org/TR/xinclude">XInclude</a>implementations.</li> |
| 147 | <li>It is written in plain C, making as few assumptions as possible, |
| 148 | andsticking closely to ANSI C/POSIX for easy embedding. Works |
| 149 | onLinux/Unix/Windows, ported to a number of other platforms.</li> |
| 150 | <li>Basic support for HTTP and FTP client allowing applications to |
| 151 | fetchremote resources.</li> |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 152 | <li>The design is modular, most of the extensions can be compiled out.</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 153 | <li>The internal document representation is as close as possible to the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 154 | href="http://www.w3.org/DOM/">DOM</a>interfaces.</li> |
Daniel Veillard | 560c2a4 | 2003-07-06 21:13:49 +0000 | [diff] [blame] | 155 | <li>Libxml2 also has a <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 156 | href="http://www.megginson.com/SAX/index.html">SAX like interface</a>;the |
| 157 | interface is designed to be compatible with <a |
Daniel Veillard | 402e8c8 | 2000-02-29 22:57:47 +0000 | [diff] [blame] | 158 | href="http://www.jclark.com/xml/expat.html">Expat</a>.</li> |
Daniel Veillard | c575b99 | 2002-02-08 13:28:40 +0000 | [diff] [blame] | 159 | <li>This library is released under the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 160 | href="http://www.opensource.org/licenses/mit-license.html">MITLicense</a>. |
| 161 | See the Copyright file in the distribution for the precisewording.</li> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 162 | </ul> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 163 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 164 | <p>Warning: unless you are forced to because your application links with |
| 165 | aGnome-1.X library requiring it, <strong><span |
| 166 | style="background-color: #FF0000">Do Not Use libxml1</span></strong>, |
| 167 | uselibxml2</p> |
Daniel Veillard | e0c1d72 | 2001-03-21 10:28:36 +0000 | [diff] [blame] | 168 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 169 | <h2><a name="FAQ">FAQ</a></h2> |
| 170 | |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 171 | <p>Table of Contents:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 172 | <ul> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 173 | <li><a href="FAQ.html#License">License(s)</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 174 | <li><a href="FAQ.html#Installati">Installation</a></li> |
| 175 | <li><a href="FAQ.html#Compilatio">Compilation</a></li> |
| 176 | <li><a href="FAQ.html#Developer">Developer corner</a></li> |
| 177 | </ul> |
| 178 | |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 179 | <h3><a name="License">License</a>(s)</h3> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 180 | <ol> |
| 181 | <li><em>Licensing Terms for libxml</em> |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 182 | <p>libxml2 is released under the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 183 | href="http://www.opensource.org/licenses/mit-license.html">MITLicense</a>; |
| 184 | see the file Copyright in the distribution for the precisewording</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 185 | </li> |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 186 | <li><em>Can I embed libxml2 in a proprietary application ?</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 187 | <p>Yes. The MIT License allows you to keep proprietary the changes |
| 188 | youmade to libxml, but it would be graceful to send-back bug fixes |
| 189 | andimprovements as patches for possible incorporation in the |
| 190 | maindevelopment tree.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 191 | </li> |
| 192 | </ol> |
| 193 | |
| 194 | <h3><a name="Installati">Installation</a></h3> |
| 195 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 196 | <li><strong><span style="background-color: #FF0000">Do Not |
| 197 | Uselibxml1</span></strong>, use libxml2</li> |
| 198 | <li><em>Where can I get libxml</em>? |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 199 | <p>The original distribution comes from <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 200 | href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a>or <a |
Daniel Veillard | 024f199 | 2003-12-10 16:43:49 +0000 | [diff] [blame] | 201 | href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/">gnome.org</a></p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 202 | <p>Most Linux and BSD distributions include libxml, this is probably |
| 203 | thesafer way for end-users to use libxml.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 204 | <p>David Doolin provides precompiled Windows versions at <a |
| 205 | href="http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/ ">http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/</a></p> |
| 206 | </li> |
| 207 | <li><em>I see libxml and libxml2 releases, which one should I install ?</em> |
| 208 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 209 | <li>If you are not constrained by backward compatibility issues |
| 210 | withexisting applications, install libxml2 only</li> |
| 211 | <li>If you are not doing development, you can safely install |
| 212 | both.Usually the packages <a |
| 213 | href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a>and <a |
| 214 | href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a>arecompatible |
| 215 | (this is not the case for development packages).</li> |
| 216 | <li>If you are a developer and your system provides separate |
| 217 | packagingfor shared libraries and the development components, it is |
| 218 | possibleto install libxml and libxml2, and also <a |
| 219 | href="http://rpmfind.net/linux/RPM/libxml-devel.html">libxml-devel</a>and |
| 220 | <a |
| 221 | href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml2-devel</a>too |
| 222 | for libxml2 >= 2.3.0</li> |
| 223 | <li>If you are developing a new application, please develop |
| 224 | againstlibxml2(-devel)</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 225 | </ul> |
| 226 | </li> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 227 | <li><em>I can't install the libxml package, it conflicts with libxml0</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 228 | <p>You probably have an old libxml0 package used to provide the |
| 229 | sharedlibrary for libxml.so.0, you can probably safely remove it. The |
| 230 | libxmlpackages provided on <a |
| 231 | href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a>providelibxml.so.0</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 232 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 233 | <li><em>I can't install the libxml(2) RPM package due to |
| 234 | faileddependencies</em> |
| 235 | <p>The most generic solution is to re-fetch the latest src.rpm , |
| 236 | andrebuild it locally with</p> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 237 | <p><code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 238 | <p>If everything goes well it will generate two binary rpm packages |
| 239 | (oneproviding the shared libs and xmllint, and the other one, the |
| 240 | -develpackage, providing includes, static libraries and scripts needed to |
| 241 | buildapplications with libxml(2)) that you can install locally.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 242 | </li> |
| 243 | </ol> |
| 244 | |
| 245 | <h3><a name="Compilatio">Compilation</a></h3> |
| 246 | <ol> |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 247 | <li><em>What is the process to compile libxml2 ?</em> |
| 248 | <p>As most UNIX libraries libxml2 follows the "standard":</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 249 | <p><code>gunzip -c xxx.tar.gz | tar xvf -</code></p> |
| 250 | <p><code>cd libxml-xxxx</code></p> |
| 251 | <p><code>./configure --help</code></p> |
| 252 | <p>to see the options, then the compilation/installation proper</p> |
| 253 | <p><code>./configure [possible options]</code></p> |
| 254 | <p><code>make</code></p> |
| 255 | <p><code>make install</code></p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 256 | <p>At that point you may have to rerun ldconfig or a similar utility |
| 257 | toupdate your list of installed shared libs.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 258 | </li> |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 259 | <li><em>What other libraries are needed to compile/install libxml2 ?</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 260 | <p>Libxml2 does not require any other library, the normal C ANSI |
| 261 | APIshould be sufficient (please report any violation to this rule you |
| 262 | mayfind).</p> |
| 263 | <p>However if found at configuration time libxml2 will detect and use |
| 264 | thefollowing libs:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 265 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 266 | <li><a href="http://www.info-zip.org/pub/infozip/zlib/">libz</a>: |
| 267 | ahighly portable and available widely compression library.</li> |
| 268 | <li>iconv: a powerful character encoding conversion library. It |
| 269 | isincluded by default in recent glibc libraries, so it doesn't need |
| 270 | tobe installed specifically on Linux. It now seems a <a |
| 271 | href="http://www.opennc.org/onlinepubs/7908799/xsh/iconv.html">partof |
| 272 | the official UNIX</a>specification. Here is one <a |
| 273 | href="http://www.gnu.org/software/libiconv/">implementation of |
| 274 | thelibrary</a>which source can be found <a |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 275 | href="ftp://ftp.ilog.fr/pub/Users/haible/gnu/">here</a>.</li> |
| 276 | </ul> |
| 277 | </li> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 278 | <li><em>Make check fails on some platforms</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 279 | <p>Sometimes the regression tests' results don't completely match |
| 280 | thevalue produced by the parser, and the makefile uses diff to print |
| 281 | thedelta. On some platforms the diff return breaks the compilation |
| 282 | process;if the diff is small this is probably not a serious problem.</p> |
| 283 | <p>Sometimes (especially on Solaris) make checks fail due to |
| 284 | limitationsin make. Try using GNU-make instead.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 285 | </li> |
| 286 | <li><em>I use the CVS version and there is no configure script</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 287 | <p>The configure script (and other Makefiles) are generated. Use |
| 288 | theautogen.sh script to regenerate the configure script and |
| 289 | Makefiles,like:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 290 | <p><code>./autogen.sh --prefix=/usr --disable-shared</code></p> |
| 291 | </li> |
| 292 | <li><em>I have troubles when running make tests with gcc-3.0</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 293 | <p>It seems the initial release of gcc-3.0 has a problem with |
| 294 | theoptimizer which miscompiles the URI module. Please use |
| 295 | anothercompiler.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 296 | </li> |
| 297 | </ol> |
| 298 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 299 | <h3><a name="Developer">Developer</a>corner</h3> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 300 | <ol> |
Daniel Veillard | 93d9525 | 2003-04-29 20:25:40 +0000 | [diff] [blame] | 301 | <li><em>Troubles compiling or linking programs using libxml2</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 302 | <p>Usually the problem comes from the fact that the compiler doesn't |
| 303 | getthe right compilation or linking flags. There is a small shell |
| 304 | script<code>xml2-config</code>which is installed as part of libxml2 |
| 305 | usualinstall process which provides those flags. Use</p> |
Daniel Veillard | 93d9525 | 2003-04-29 20:25:40 +0000 | [diff] [blame] | 306 | <p><code>xml2-config --cflags</code></p> |
| 307 | <p>to get the compilation flags and</p> |
| 308 | <p><code>xml2-config --libs</code></p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 309 | <p>to get the linker flags. Usually this is done directly from |
| 310 | theMakefile as:</p> |
Daniel Veillard | 93d9525 | 2003-04-29 20:25:40 +0000 | [diff] [blame] | 311 | <p><code>CFLAGS=`xml2-config --cflags`</code></p> |
| 312 | <p><code>LIBS=`xml2-config --libs`</code></p> |
| 313 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 314 | <li><em>I want to install my own copy of libxml2 in my home directory |
| 315 | andlink my programs against it, but it doesn't work</em> |
| 316 | <p>There are many different ways to accomplish this. Here is one way |
| 317 | todo this under Linux. Suppose your home directory is |
| 318 | <code>/home/user.</code>Then:</p> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 319 | <ul> |
| 320 | <li>Create a subdirectory, let's call it <code>myxml</code></li> |
William M. Brack | 99906ad | 2005-01-09 17:02:42 +0000 | [diff] [blame] | 321 | <li>unpack the libxml2 distribution into that subdirectory</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 322 | <li>chdir into the unpacked distribution(<code>/home/user/myxml/libxml2 |
| 323 | </code>)</li> |
| 324 | <li>configure the library using the "<code>--prefix</code>" |
| 325 | switch,specifying an installation subdirectory |
| 326 | in<code>/home/user/myxml</code>, e.g. |
| 327 | <p><code>./configure --prefix |
| 328 | /home/user/myxml/xmlinst</code>{otherconfiguration options}</p> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 329 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 330 | <li>now run <code>make</code>followed by <code>make install</code></li> |
| 331 | <li>At this point, the installation subdirectory contains the |
| 332 | complete"private" include files, library files and binary program |
| 333 | files (e.g.xmllint), located in |
| 334 | <p><code>/home/user/myxml/xmlinst/lib,/home/user/myxml/xmlinst/include |
| 335 | </code>and <code>/home/user/myxml/xmlinst/bin</code></p> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 336 | respectively.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 337 | <li>In order to use this "private" library, you should first add it |
| 338 | tothe beginning of your default PATH (so that your own private |
| 339 | programfiles such as xmllint will be used instead of the normal |
| 340 | systemones). To do this, the Bash command would be |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 341 | <p><code>export PATH=/home/user/myxml/xmlinst/bin:$PATH</code></p> |
| 342 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 343 | <li>Now suppose you have a program <code>test1.c</code>that you |
| 344 | wouldlike to compile with your "private" library. Simply compile it |
| 345 | usingthe command |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 346 | <p><code>gcc `xml2-config --cflags --libs` -o test test.c</code></p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 347 | Note that, because your PATH has been set with |
| 348 | <code>/home/user/myxml/xmlinst/bin</code>at the beginning, the |
| 349 | xml2-configprogram which you just installed will be used instead of |
| 350 | the systemdefault one, and this will <em>automatically</em>get the |
| 351 | correctlibraries linked with your program.</li> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 352 | </ul> |
| 353 | </li> |
| 354 | |
| 355 | <p></p> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 356 | <li><em>xmlDocDump() generates output on one line.</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 357 | <p>Libxml2 will not <strong>invent</strong>spaces in the content of |
| 358 | adocument since <strong>all spaces in the content of a document |
| 359 | aresignificant</strong>. If you build a tree from the API and |
| 360 | wantindentation:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 361 | <ol> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 362 | <li>the correct way is to generate those yourself too.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 363 | <li>the dangerous way is to ask libxml2 to add those blanks to |
| 364 | yourcontent <strong>modifying the content of your document in |
| 365 | theprocess</strong>. The result may not be what you expect. There |
| 366 | is<strong>NO</strong>way to guarantee that such a modification |
| 367 | won'taffect other parts of the content of your document. See <a |
| 368 | href="http://xmlsoft.org/html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault()</a>and |
| 369 | <a |
| 370 | href="http://xmlsoft.org/html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile()</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 371 | </ol> |
| 372 | </li> |
| 373 | <li>Extra nodes in the document: |
| 374 | <p><em>For a XML file as below:</em></p> |
| 375 | <pre><?xml version="1.0"?> |
| 376 | <PLAN xmlns="http://www.argus.ca/autotest/1.0/"> |
| 377 | <NODE CommFlag="0"/> |
| 378 | <NODE CommFlag="1"/> |
| 379 | </PLAN></pre> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 380 | <p><em>after parsing it with the |
| 381 | functionpxmlDoc=xmlParseFile(...);</em></p> |
| 382 | <p><em>I want to the get the content of the first node (node with |
| 383 | theCommFlag="0")</em></p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 384 | <p><em>so I did it as following;</em></p> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 385 | <pre>xmlNodePtr pnode; |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 386 | pnode=pxmlDoc->children->children;</pre> |
| 387 | <p><em>but it does not work. If I change it to</em></p> |
| 388 | <pre>pnode=pxmlDoc->children->children->next;</pre> |
| 389 | <p><em>then it works. Can someone explain it to me.</em></p> |
| 390 | <p></p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 391 | <p>In XML all characters in the content of the document are |
| 392 | significant<strong>including blanks and formatting line |
| 393 | breaks</strong>.</p> |
| 394 | <p>The extra nodes you are wondering about are just that, text nodes |
| 395 | withthe formatting spaces which are part of the document but that people |
| 396 | tendto forget. There is a function <a |
| 397 | href="http://xmlsoft.org/html/libxml-parser.html">xmlKeepBlanksDefault()</a>to |
| 398 | remove those at parse time, but that's an heuristic, and itsuse should be |
| 399 | limited to cases where you are certain there is nomixed-content in the |
| 400 | document.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 401 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 402 | <li><em>I get compilation errors of existing code like when |
| 403 | accessing<strong>root</strong>or <strong>child fields</strong>of |
| 404 | nodes.</em> |
| 405 | <p>You are compiling code developed for libxml version 1 and using |
| 406 | alibxml2 development environment. Either switch back to libxml v1 devel |
| 407 | oreven better fix the code to compile with libxml2 (or both) by <a |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 408 | href="upgrade.html">following the instructions</a>.</p> |
| 409 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 410 | <li><em>I get compilation errors about non |
| 411 | existing<strong>xmlRootNode</strong>or |
| 412 | <strong>xmlChildrenNode</strong>fields.</em> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 413 | <p>The source code you are using has been <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 414 | href="upgrade.html">upgraded</a>to be able to compile with both libxmland |
| 415 | libxml2, but you need to install a more recent version:libxml(-devel) |
| 416 | >= 1.8.8 or libxml2(-devel) >= 2.1.0</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 417 | </li> |
| 418 | <li><em>XPath implementation looks seriously broken</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 419 | <p>XPath implementation prior to 2.3.0 was really incomplete. Upgrade toa |
| 420 | recent version, there are no known bugs in the current version.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 421 | </li> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 422 | <li><em>The example provided in the web page does not compile.</em> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 423 | <p>It's hard to maintain the documentation in sync with the |
| 424 | code<grin/> ...</p> |
| 425 | <p>Check the previous points 1/ and 2/ raised before, and please |
| 426 | sendpatches.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 427 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 428 | <li><em>Where can I get more examples and information than provided on |
| 429 | theweb page?</em> |
| 430 | <p>Ideally a libxml2 book would be nice. I have no such plan ... But |
| 431 | youcan:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 432 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 433 | <li>check more deeply the <a |
| 434 | href="html/libxml-lib.html">existinggenerated doc</a></li> |
| 435 | <li>have a look at <a href="examples/index.html">the set |
| 436 | ofexamples</a>.</li> |
| 437 | <li>look for examples of use for libxml2 function using the Gnome |
| 438 | code.For example the following will query the full Gnome CVS base for |
| 439 | theuse of the <strong>xmlAddChild()</strong>function: |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 440 | <p><a |
| 441 | href="http://cvs.gnome.org/lxr/search?string=xmlAddChild">http://cvs.gnome.org/lxr/search?string=xmlAddChild</a></p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 442 | <p>This may be slow, a large hardware donation to the gnome |
| 443 | projectcould cure this :-)</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 444 | </li> |
| 445 | <li><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 446 | href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=gnome-xml">Browsethe |
| 447 | libxml2 source</a>, I try to write code as clean and documentedas |
| 448 | possible, so looking at it may be helpful. In particular the codeof |
| 449 | xmllint.c and of the various testXXX.c test programs shouldprovide |
| 450 | good examples of how to do things with the library.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 451 | </ul> |
| 452 | </li> |
| 453 | <li>What about C++ ? |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 454 | <p>libxml2 is written in pure C in order to allow easy reuse on a |
| 455 | numberof platforms, including embedded systems. I don't intend to convert |
| 456 | toC++.</p> |
Daniel Veillard | 91e69c5 | 2003-08-04 01:43:07 +0000 | [diff] [blame] | 457 | <p>There is however a C++ wrapper which may fulfill your needs:</p> |
Daniel Veillard | 9b6fd30 | 2002-05-13 12:06:47 +0000 | [diff] [blame] | 458 | <ul> |
| 459 | <li>by Ari Johnson <ari@btigate.com>: |
| 460 | <p>Website: <a |
Daniel Veillard | 91e69c5 | 2003-08-04 01:43:07 +0000 | [diff] [blame] | 461 | href="http://libxmlplusplus.sourceforge.net/">http://libxmlplusplus.sourceforge.net/</a></p> |
Daniel Veillard | 9b6fd30 | 2002-05-13 12:06:47 +0000 | [diff] [blame] | 462 | <p>Download: <a |
Daniel Veillard | 91e69c5 | 2003-08-04 01:43:07 +0000 | [diff] [blame] | 463 | href="http://sourceforge.net/project/showfiles.php?group_id=12999">http://sourceforge.net/project/showfiles.php?group_id=12999</a></p> |
Daniel Veillard | 9b6fd30 | 2002-05-13 12:06:47 +0000 | [diff] [blame] | 464 | </li> |
Daniel Veillard | 83ee40d | 2003-08-09 22:24:09 +0000 | [diff] [blame] | 465 | <!-- Website is currently unavailable as of 2003-08-02 |
Daniel Veillard | 9b6fd30 | 2002-05-13 12:06:47 +0000 | [diff] [blame] | 466 | <li>by Peter Jones <pjones@pmade.org> |
Daniel Veillard | 83ee40d | 2003-08-09 22:24:09 +0000 | [diff] [blame] | 467 | <p>Website: <a |
| 468 | href="http://pmade.org/pjones/software/xmlwrapp/">http://pmade.org/pjones/software/xmlwrapp/</a></p> |
Daniel Veillard | 9b6fd30 | 2002-05-13 12:06:47 +0000 | [diff] [blame] | 469 | </li> |
Daniel Veillard | 83ee40d | 2003-08-09 22:24:09 +0000 | [diff] [blame] | 470 | --> |
Daniel Veillard | 9b6fd30 | 2002-05-13 12:06:47 +0000 | [diff] [blame] | 471 | </ul> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 472 | </li> |
| 473 | <li>How to validate a document a posteriori ? |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 474 | <p>It is possible to validate documents which had not been validated |
| 475 | atinitial parsing time or documents which have been built from |
| 476 | scratchusing the API. Use the <a |
| 477 | href="http://xmlsoft.org/html/libxml-valid.html#xmlValidateDtd">xmlValidateDtd()</a>function. |
| 478 | It is also possible to simply add a DTD to an existingdocument:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 479 | <pre>xmlDocPtr doc; /* your existing document */ |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 480 | xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */ |
| 481 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 482 | dtd->name = xmlStrDup((xmlChar*)"root_name"); /* use the given root */ |
| 483 | |
| 484 | doc->intSubset = dtd; |
| 485 | if (doc->children == NULL) xmlAddChild((xmlNodePtr)doc, (xmlNodePtr)dtd); |
| 486 | else xmlAddPrevSibling(doc->children, (xmlNodePtr)dtd); |
| 487 | </pre> |
| 488 | </li> |
Daniel Veillard | dad3f68 | 2002-11-17 16:47:27 +0000 | [diff] [blame] | 489 | <li>So what is this funky "xmlChar" used all the time? |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 490 | <p>It is a null terminated sequence of utf-8 characters. And only |
| 491 | utf-8!You need to convert strings encoded in different ways to utf-8 |
| 492 | beforepassing them to the API. This can be accomplished with the iconv |
| 493 | libraryfor instance.</p> |
John Fleck | 61f6fb6 | 2002-10-31 15:23:29 +0000 | [diff] [blame] | 494 | </li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 495 | <li>etc ...</li> |
| 496 | </ol> |
| 497 | |
| 498 | <p></p> |
| 499 | |
Daniel Veillard | 66f68e7 | 2003-08-18 16:39:51 +0000 | [diff] [blame] | 500 | <h2><a name="Documentat">Developer Menu</a></h2> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 501 | |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 502 | <p>There are several on-line resources related to using libxml:</p> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 503 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 504 | <li>Use the <a href="search.php">search engine</a>to look |
| 505 | upinformation.</li> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 506 | <li>Check the <a href="FAQ.html">FAQ.</a></li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 507 | <li>Check the <a |
| 508 | href="http://xmlsoft.org/html/libxml-lib.html">extensivedocumentation</a>automatically |
| 509 | extracted from code comments.</li> |
| 510 | <li>Look at the documentation about <a |
| 511 | href="encoding.html">libxmlinternationalization support</a>.</li> |
| 512 | <li>This page provides a global overview and <a |
| 513 | href="example.html">someexamples</a>on how to use libxml.</li> |
Daniel Veillard | c480c4e | 2003-12-10 13:24:38 +0000 | [diff] [blame] | 514 | <li><a href="examples/index.html">Code examples</a></li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 515 | <li>John Fleck's libxml2 tutorial: <a href="tutorial/index.html">html</a>or |
| 516 | <a href="tutorial/xmltutorial.pdf">pdf</a>.</li> |
Daniel Veillard | 1177ca4 | 2003-04-26 22:29:54 +0000 | [diff] [blame] | 517 | <li>If you need to parse large files, check the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 518 | href="xmlreader.html">xmlReader</a>API tutorial</li> |
| 519 | <li><a href="mailto:james@daa.com.au">James Henstridge</a>wrote <a |
| 520 | href="http://www.daa.com.au/~james/gnome/xml-sax/xml-sax.html">some |
| 521 | nicedocumentation</a>explaining how to use the libxml SAX interface.</li> |
Daniel Veillard | c480c4e | 2003-12-10 13:24:38 +0000 | [diff] [blame] | 522 | <li>George Lebl wrote <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 523 | href="http://www-106.ibm.com/developerworks/library/l-gnome3/">an |
| 524 | articlefor IBM developerWorks</a>about using libxml.</li> |
| 525 | <li>Check <a href="http://cvs.gnome.org/lxr/source/gnome-xml/TODO">the |
| 526 | TODOfile</a>.</li> |
| 527 | <li>Read the <a href="upgrade.html">1.x to 2.x upgrade path</a>description. |
| 528 | If you are starting a new project using libxml you shouldreally use the |
| 529 | 2.x version.</li> |
Daniel Veillard | 845cce4 | 2002-01-09 11:51:37 +0000 | [diff] [blame] | 530 | <li>And don't forget to look at the <a |
| 531 | href="http://mail.gnome.org/archives/xml/">mailing-list archive</a>.</li> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 532 | </ol> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 533 | |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 534 | <h2><a name="Reporting">Reporting bugs and getting help</a></h2> |
Daniel Veillard | 4c3a203 | 1999-11-19 17:46:26 +0000 | [diff] [blame] | 535 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 536 | <p>Well, bugs or missing features are always possible, and I will make apoint |
| 537 | of fixing them in a timely fashion. The best way to report a bug is touse the |
| 538 | <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Gnomebug |
| 539 | tracking database</a>(make sure to use the "libxml2" module name). Ilook at |
| 540 | reports there regularly and it's good to have a reminder when a bugis still |
| 541 | open. Be sure to specify that the bug is for the package libxml2.</p> |
Daniel Veillard | 4c3a203 | 1999-11-19 17:46:26 +0000 | [diff] [blame] | 542 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 543 | <p>For small problems you can try to get help on IRC, the #xml channel |
| 544 | onirc.gnome.org (port 6667) usually have a few person subscribed which may |
| 545 | help(but there is no garantee and if a real issue is raised it should go on |
| 546 | themailing-list for archival).</p> |
Daniel Veillard | 9582d6c | 2003-09-16 11:40:04 +0000 | [diff] [blame] | 547 | |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 548 | <p>There is also a mailing-list <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 549 | href="mailto:xml@gnome.org">xml@gnome.org</a>for libxml, with an <a |
| 550 | href="http://mail.gnome.org/archives/xml/">on-line archive</a>(<a |
| 551 | href="http://xmlsoft.org/messages">old</a>). To subscribe to this list,please |
| 552 | visit the <a href="http://mail.gnome.org/mailman/listinfo/xml">associated |
| 553 | Web</a>page andfollow the instructions. <strong>Do not send code, I won't |
| 554 | debug it</strong>(but patches are really appreciated!).</p> |
Daniel Veillard | d99224d | 2004-04-06 10:04:16 +0000 | [diff] [blame] | 555 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 556 | <p>Please note that with the current amount of virus and SPAM, sending mailto |
| 557 | the list without being subscribed won't work. There is *far too manybounces* |
| 558 | (in the order of a thousand a day !) I cannot approve them manuallyanymore. |
| 559 | If your mail to the list bounced waiting for administrator approval,it is |
| 560 | LOST ! Repost it and fix the problem triggering the error. Also pleasenote |
| 561 | that <span style="color: #FF0000; background-color: #FFFFFF">emails witha |
| 562 | legal warning asking to not copy or redistribute freely the informationsthey |
| 563 | contain</span>are <strong>NOT</strong>acceptable for the mailing-list,such |
| 564 | mail will as much as possible be discarded automatically, and are lesslikely |
| 565 | to be answered if they made it to the list, <strong>DO NOT</strong>post to |
| 566 | the list from an email address where such legal requirements areautomatically |
| 567 | added, get private paying support if you can't shareinformations.</p> |
Daniel Veillard | 234547b | 2001-07-05 09:46:10 +0000 | [diff] [blame] | 568 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 569 | <p>Check the following <strong><span |
| 570 | style="color: #FF0000">beforeposting</span></strong>:</p> |
Daniel Veillard | 234547b | 2001-07-05 09:46:10 +0000 | [diff] [blame] | 571 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 572 | <li>Read the <a href="FAQ.html">FAQ</a>and <a href="search.php">use |
| 573 | thesearch engine</a>to get information related to your problem.</li> |
| 574 | <li>Make sure you are <a href="ftp://xmlsoft.org/libxml2/">using a |
| 575 | recentversion</a>, and that the problem still shows up in a recent |
| 576 | version.</li> |
| 577 | <li>Check the <a |
| 578 | href="http://mail.gnome.org/archives/xml/">listarchives</a>to see if the |
| 579 | problem was reported already. In this casethere is probably a fix |
| 580 | available, similarly check the <a |
| 581 | href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">registeredopen |
| 582 | bugs</a>.</li> |
| 583 | <li>Make sure you can reproduce the bug with xmllint or one of the |
| 584 | testprograms found in source in the distribution.</li> |
| 585 | <li>Please send the command showing the error as well as the input (as |
| 586 | anattachment)</li> |
Daniel Veillard | 234547b | 2001-07-05 09:46:10 +0000 | [diff] [blame] | 587 | </ul> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 588 | |
Daniel Veillard | a37aab8 | 2003-06-09 09:10:36 +0000 | [diff] [blame] | 589 | <p>Then send the bug with associated information to reproduce it to the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 590 | href="mailto:xml@gnome.org">xml@gnome.org</a>list; if it's really |
| 591 | libxmlrelated I will approve it. Please do not send mail to me directly, it |
| 592 | makesthings really hard to track and in some cases I am not the best person |
| 593 | toanswer a given question, ask on the list.</p> |
Daniel Veillard | 98d071d | 2003-01-10 09:22:44 +0000 | [diff] [blame] | 594 | |
| 595 | <p>To <span style="color: #E50000">be really clear about support</span>:</p> |
| 596 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 597 | <li>Support or help <span style="color: #E50000">requests MUST be sent |
| 598 | tothe list or on bugzilla</span>in case of problems, so that the |
| 599 | Questionand Answers can be shared publicly. Failing to do so carries the |
| 600 | implicitmessage "I want free support but I don't want to share the |
| 601 | benefits withothers" and is not welcome. I will automatically Carbon-Copy |
| 602 | thexml@gnome.org mailing list for any technical reply made about libxml2 |
| 603 | orlibxslt.</li> |
| 604 | <li>There is <span style="color: #E50000">no garantee of support</span>, |
| 605 | ifyour question remains unanswered after a week, repost it, making sure |
| 606 | yougave all the detail needed and the information requested.</li> |
| 607 | <li>Failing to provide information as requested or double checking firstfor |
| 608 | prior feedback also carries the implicit message "the time of thelibrary |
| 609 | maintainers is less valuable than my time" and might not bewelcome.</li> |
Daniel Veillard | 98d071d | 2003-01-10 09:22:44 +0000 | [diff] [blame] | 610 | </ul> |
Daniel Veillard | 4c3a203 | 1999-11-19 17:46:26 +0000 | [diff] [blame] | 611 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 612 | <p>Of course, bugs reported with a suggested patch for fixing them |
| 613 | willprobably be processed faster than those without.</p> |
Daniel Veillard | ec30341 | 2000-03-24 13:41:54 +0000 | [diff] [blame] | 614 | |
| 615 | <p>If you're looking for help, a quick look at <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 616 | href="http://mail.gnome.org/archives/xml/">the list archive</a>may |
| 617 | actuallyprovide the answer. I usually send source samples when answering |
| 618 | libxml2usage questions. The <a |
| 619 | href="http://xmlsoft.org/html/book1.html">auto-generated |
| 620 | documentation</a>isnot as polished as I would like (i need to learn more |
| 621 | about DocBook), butit's a good starting point.</p> |
Daniel Veillard | ec30341 | 2000-03-24 13:41:54 +0000 | [diff] [blame] | 622 | |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 623 | <h2><a name="help">How to help</a></h2> |
| 624 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 625 | <p>You can help the project in various ways, the best thing to do first is |
| 626 | tosubscribe to the mailing-list as explained before, check the <a |
Daniel Veillard | f7ed336 | 2001-08-17 12:01:21 +0000 | [diff] [blame] | 627 | href="http://mail.gnome.org/archives/xml/">archives </a>and the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 628 | href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Gnome |
| 629 | bugdatabase</a>:</p> |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 630 | <ol> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 631 | <li>Provide patches when you find problems.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 632 | <li>Provide the diffs when you port libxml2 to a new platform. They may |
| 633 | notbe integrated in all cases but help pinpointing portability |
| 634 | problemsand</li> |
| 635 | <li>Provide documentation fixes (either as patches to the code comments |
| 636 | oras HTML diffs).</li> |
| 637 | <li>Provide new documentations pieces (translations, examples, etc...).</li> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 638 | <li>Check the TODO file and try to close one of the items.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 639 | <li>Take one of the points raised in the archive or the bug database |
| 640 | andprovide a fix. <a href="mailto:daniel@veillard.com">Get in touch with |
| 641 | me</a>before to avoid synchronization problems and check that the |
| 642 | suggestedfix will fit in nicely :-)</li> |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 643 | </ol> |
| 644 | |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 645 | <h2><a name="Downloads">Downloads</a></h2> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 646 | |
Daniel Veillard | 688f669 | 2004-03-26 10:57:38 +0000 | [diff] [blame] | 647 | <p>The latest versions of libxml2 can be found on the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 648 | href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a>server ( <a |
Daniel Veillard | eca726d | 2004-04-18 21:47:34 +0000 | [diff] [blame] | 649 | href="http://xmlsoft.org/sources/">HTTP</a>, <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 650 | href="ftp://xmlsoft.org/libxml2/">FTP</a>and rsync are available), there is |
| 651 | alsomirrors (<a href="ftp://ftp.planetmirror.com/pub/xmlsoft/">Australia</a>( |
| 652 | <a href="http://xmlsoft.planetmirror.com/">Web</a>), <a |
Daniel Veillard | 20c8cf2 | 2001-06-26 22:47:36 +0000 | [diff] [blame] | 653 | href="ftp://fr.rpmfind.net/pub/libxml/">France</a>) or on the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 654 | href="ftp://ftp.gnome.org/pub/GNOME/MIRRORS.html">Gnome FTP server</a>as <a |
| 655 | href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/">source archive</a>, |
| 656 | Antonin Sprinzl also provide <a |
| 657 | href="ftp://gd.tuwien.ac.at/pub/libxml/">amirror in Austria</a>. (NOTE that |
| 658 | you need both the <a |
| 659 | href="http://rpmfind.net/linux/RPM/libxml2.html">libxml(2)</a>and <a |
| 660 | href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml(2)-devel</a>packages |
| 661 | installed to compile applications using libxml.)</p> |
Daniel Veillard | eca726d | 2004-04-18 21:47:34 +0000 | [diff] [blame] | 662 | |
| 663 | <p>You can find all the history of libxml(2) and libxslt releases in the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 664 | href="http://xmlsoft.org/sources/old/">old</a>directory. The |
| 665 | precompiledWindows binaries made by Igor Zlatovic are available in the <a |
| 666 | href="http://xmlsoft.org/sources/win32/">win32</a>directory.</p> |
Daniel Veillard | b46a573 | 2003-04-08 13:35:48 +0000 | [diff] [blame] | 667 | |
| 668 | <p>Binary ports:</p> |
| 669 | <ul> |
| 670 | <li>Red Hat RPMs for i386 are available directly on <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 671 | href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a>, the source RPM will |
| 672 | compile onany architecture supported by Red Hat.</li> |
| 673 | <li><a href="mailto:igor@zlatkovic.com">Igor Zlatkovic</a>is now |
| 674 | themaintainer of the Windows port, <a |
| 675 | href="http://www.zlatkovic.com/projects/libxml/index.html">he |
| 676 | providesbinaries</a>.</li> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 677 | <li>Blastwave provides <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 678 | href="http://www.blastwave.org/packages.php/libxml2">Solarisbinaries</a>.</li> |
| 679 | <li><a href="mailto:Steve.Ball@explain.com.au">Steve Ball</a>provides <a |
| 680 | href="http://www.explain.com.au/oss/libxml2xslt.html">Mac Os |
| 681 | Xbinaries</a>.</li> |
Daniel Veillard | b46a573 | 2003-04-08 13:35:48 +0000 | [diff] [blame] | 682 | <li>The HP-UX porting center provides <a |
| 683 | href="http://hpux.connect.org.uk/hppd/hpux/Gnome/">HP-UX binaries</a></li> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 684 | <li>Bull provides precompiled <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 685 | href="http://gnome.bullfreeware.com/new_index.html">RPMs for |
| 686 | AIX</a>aspatr of their GNOME packages</li> |
Daniel Veillard | b46a573 | 2003-04-08 13:35:48 +0000 | [diff] [blame] | 687 | </ul> |
| 688 | |
| 689 | <p>If you know other supported binary ports, please <a |
| 690 | href="http://veillard.com/">contact me</a>.</p> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 691 | |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 692 | <p><a name="Snapshot">Snapshot:</a></p> |
| 693 | <ul> |
Daniel Veillard | 3cef119 | 2004-08-18 09:30:31 +0000 | [diff] [blame] | 694 | <li>Code from the W3C cvs base libxml2 module, updated hourly <a |
Daniel Veillard | 9110ed6 | 2006-04-03 15:21:57 +0000 | [diff] [blame] | 695 | href="ftp://xmlsoft.org/libxml2/libxml2-cvs-snapshot.tar.gz">libxml2-cvs-snapshot.tar.gz</a>.</li> |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 696 | <li>Docs, content of the web site, the list archive included <a |
Daniel Veillard | 9110ed6 | 2006-04-03 15:21:57 +0000 | [diff] [blame] | 697 | href="ftp://xmlsoft.org/libxml2/libxml-docs.tar.gz">libxml-docs.tar.gz</a>.</li> |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 698 | </ul> |
| 699 | |
Daniel Veillard | c6271d2 | 2001-10-27 07:50:58 +0000 | [diff] [blame] | 700 | <p><a name="Contribs">Contributions:</a></p> |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 701 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 702 | <p>I do accept external contributions, especially if compiling on |
| 703 | anotherplatform, get in touch with the list to upload the package, wrappers |
| 704 | forvarious languages have been provided, and can be found in the <a |
Daniel Veillard | d99224d | 2004-04-06 10:04:16 +0000 | [diff] [blame] | 705 | href="python.html">bindings section</a></p> |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 706 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 707 | <p>Libxml2 is also available from CVS:</p> |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 708 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 709 | <li><p>The <a href="http://cvs.gnome.org/viewcvs/libxml2/">Gnome |
| 710 | CVSbase</a>. Check the <a |
| 711 | href="http://developer.gnome.org/tools/cvs.html">Gnome CVS Tools</a>page; |
| 712 | the CVS module is <b>libxml2</b>.</p> |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 713 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 714 | <li>The <strong>libxslt</strong>module is also present there</li> |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 715 | </ul> |
| 716 | |
Daniel Veillard | 78fed53 | 2004-10-09 19:44:48 +0000 | [diff] [blame] | 717 | <h2><a name="News">Releases</a></h2> |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 718 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 719 | <p>Items not finished and worked on, get in touch with the list if you wantto |
| 720 | help those</p> |
Daniel Veillard | ab8500d | 2000-10-15 21:06:19 +0000 | [diff] [blame] | 721 | <ul> |
Daniel Veillard | 72fef16 | 2003-02-05 14:31:19 +0000 | [diff] [blame] | 722 | <li>More testing on RelaxNG</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 723 | <li>Finishing up <a |
| 724 | href="http://www.w3.org/TR/xmlschema-1/">XMLSchemas</a></li> |
Daniel Veillard | 72fef16 | 2003-02-05 14:31:19 +0000 | [diff] [blame] | 725 | </ul> |
| 726 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 727 | <p>The <a href="ChangeLog.html">change log</a>describes the recents commitsto |
| 728 | the <a href="http://cvs.gnome.org/viewcvs/libxml2/">CVS</a>code base.</p> |
Daniel Veillard | 2d90803 | 2004-08-10 10:16:36 +0000 | [diff] [blame] | 729 | |
Daniel Veillard | d99224d | 2004-04-06 10:04:16 +0000 | [diff] [blame] | 730 | <p>There is the list of public releases:</p> |
| 731 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 732 | <h3>2.6.25: Jun 6 2006</h3> |
| 733 | <ul> |
| 734 | <li>portability fixes: Python detection (Joseph Sacco), compilation error |
| 735 | (William Brack and Graham Bennett), LynxOS patch (Olli Savia)</li> |
| 736 | <li>bug fixes: encoding buffer problem, mix of code and data in xmlIO.c |
| 737 | (Kjartan Maraas), entities in XSD validation (Kasimier Buchcik), various |
| 738 | XSD validation fixes (Kasimier), memory leak in pattern (Rob Richards and |
| 739 | Kasimier), attribute with colon in name (Rob Richards), XPath leak in |
| 740 | error reporting (Aleksey Sanin), XInclude text include of self |
| 741 | document.</li> |
| 742 | <li>improvements: Xpath optimizations (Kasimier), XPath object cache |
| 743 | (Kasimier), </li> |
| 744 | </ul> |
| 745 | |
Daniel Veillard | b2f8f1d | 2006-04-28 16:30:48 +0000 | [diff] [blame] | 746 | <h3>2.6.24: Apr 28 2006</h3> |
| 747 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 748 | <li>Portability fixes: configure on Windows, testapi compile on |
| 749 | windows(Kasimier Buchcik, venkat naidu), Borland C++ 6 compile (Eric |
| 750 | Zurcher),HP-UX compiler workaround (Rick Jones), xml2-config bugfix, |
| 751 | gcc-4.1cleanups, Python detection scheme (Joseph Sacco), UTF-8 file paths |
| 752 | onWindows (Roland Schwingel).</li> |
| 753 | <li>Improvements: xmlDOMWrapReconcileNamespaces xmlDOMWrapCloneNode |
| 754 | (KasimierBuchcik), XML catalog debugging (Rick Jones), update to Unicode |
| 755 | 4.01.</li> |
| 756 | <li>Bug fixes: xmlParseChunk() problem in 2.6.23, xmlParseInNodeContext()on |
| 757 | HTML docs, URI behaviour on Windows (Rob Richards), comment streamingbug, |
| 758 | xmlParseComment (with William Brack), regexp bug fixes (DV &Youri |
| 759 | Golovanov), xmlGetNodePath on text/CDATA (Kasimier),one Relax-NG |
| 760 | interleave bug, xmllint --path and --valid,XSD bugfixes (Kasimier), |
| 761 | remove debugleft in Python bindings (Nic Ferrier), xmlCatalogAdd bug |
| 762 | (Martin Cole),xmlSetProp fixes (Rob Richards), HTML IDness (Rob |
| 763 | Richards), a largenumber of cleanups and small fixes based on Coverity |
| 764 | reports, bugin character ranges, Unicode tables const (Aivars Kalvans), |
| 765 | schemasfix (Stefan Kost), xmlRelaxNGParse error |
| 766 | deallocation,xmlSchemaAddSchemaDoc error deallocation, error handling on |
| 767 | unallowedcode point, ixmllint --nonet to never reach the net (Gary |
| 768 | Coady),line break in writer after end PI (Jason Viers).</li> |
Daniel Veillard | b2f8f1d | 2006-04-28 16:30:48 +0000 | [diff] [blame] | 769 | <li>Documentation: man pages updates and cleanups (Daniel Leidert).</li> |
| 770 | <li>New features: Relax NG structure error handlers.</li> |
| 771 | </ul> |
| 772 | |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 773 | <h3>2.6.23: Jan 5 2006</h3> |
| 774 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 775 | <li>portability fixes: Windows (Rob Richards), getaddrinfo on Windows(Kolja |
| 776 | Nowak, Rob Richards), icc warnings (Kjartan Maraas),--with-minimum |
| 777 | compilation fixes (William Brack), error case handling fixon Solaris |
| 778 | (Albert Chin), don't use 'list' as parameter name reported bySamuel Diaz |
| 779 | Garcia, more old Unices portability fixes (Albert Chin),MinGW compilation |
| 780 | (Mark Junker), HP-UX compiler warnings (RickJones),</li> |
| 781 | <li>code cleanup: xmlReportError (Adrian Mouat), remove |
| 782 | xmlBufferClose(Geert Jansen), unreachable code (Oleksandr Kononenko), |
| 783 | refactoringparsing code (Bjorn Reese)</li> |
| 784 | <li>bug fixes: xmlBuildRelativeURI and empty path (William |
| 785 | Brack),combinatory explosion and performances in regexp code, leak |
| 786 | inxmlTextReaderReadString(), xmlStringLenDecodeEntities problem |
| 787 | (MassimoMorara), Identity Constraints bugs and a segfault (Kasimier |
| 788 | Buchcik),XPath pattern based evaluation bugs (DV & |
| 789 | Kasimier),xmlSchemaContentModelDump() memory leak (Kasimier), potential |
| 790 | leak inxmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() misuse |
| 791 | ofvsnprintf (William Brack), XHTML serialization fix (Rob Richards), |
| 792 | CRLFsplit problem (William), issues with non-namespaced attributes |
| 793 | inxmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() (Rob |
| 794 | Richards),HTML parsing of script, Python must not output to stdout (Nic |
| 795 | Ferrier),exclusive C14N namespace visibility (Aleksey Sanin), XSD |
| 796 | dataypetotalDigits bug (Kasimier Buchcik), error handling when writing to |
| 797 | anxmlBuffer (Rob Richards), runtest schemas error not reported |
| 798 | (HisashiFujinaka), signed/unsigned problem in date/time code (Albert |
| 799 | Chin), fixXSI driven XSD validation (Kasimier), parsing of xs:decimal |
| 800 | (Kasimier),fix DTD writer output (Rob Richards), leak in |
| 801 | xmlTextReaderReadInnerXml(Gary Coady), regexp bug affecting schemas |
| 802 | (Kasimier), configuration ofruntime debugging (Kasimier), |
| 803 | xmlNodeBufGetContent bug on entity refs(Oleksandr Kononenko), |
| 804 | xmlRegExecPushString2 bug (Sreeni Nair),compilation and build fixes |
| 805 | (Michael Day), removed dependancies onxmlSchemaValidError (Kasimier), bug |
| 806 | with <xml:foo/>, more XPathpattern based evaluation fixes |
| 807 | (Kasimier)</li> |
| 808 | <li>improvements: XSD Schemas redefinitions/restrictions (KasimierBuchcik), |
| 809 | node copy checks and fix for attribute (Rob Richards), countedtransition |
| 810 | bug in regexps, ctxt->standalone = -2 to indicate nostandalone |
| 811 | attribute was found, add xmlSchemaSetParserStructuredErrors()(Kasimier |
| 812 | Buchcik), add xmlTextReaderSchemaValidateCtxt() to API(Kasimier), handle |
| 813 | gzipped HTTP resources (Gary Coady), addhtmlDocDumpMemoryFormat. (Rob |
| 814 | Richards),</li> |
| 815 | <li>documentation: typo (Michael Day), libxml man page (Albert Chin), |
| 816 | savefunction to XML buffer (Geert Jansen), small doc fix (Aron |
| 817 | Stansvik),</li> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 818 | </ul> |
| 819 | |
Daniel Veillard | 33b20b7 | 2005-09-12 21:43:20 +0000 | [diff] [blame] | 820 | <h3>2.6.22: Sep 12 2005</h3> |
| 821 | <ul> |
| 822 | <li>build fixes: compile without schematron (Stéphane Bidoul)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 823 | <li>bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i,CDATA |
| 824 | push parser bug, xmlElemDump problem with XHTML1 doc,XML_FEATURE_xxx |
| 825 | clash with expat headers renamed XML_WITH_xxx, fix someoutput formatting |
| 826 | for meta element (Rob Richards), script and styleXHTML1 serialization |
| 827 | (David Madore), Attribute derivation fixups in XSD(Kasimier Buchcik), |
| 828 | better IDC error reports (Kasimier Buchcik)</li> |
| 829 | <li>improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), |
| 830 | addXML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing |
| 831 | forderive (Kasimier Buchcik).</li> |
| 832 | <li>documentation: generation of gtk-doc like docs, integration |
| 833 | withdevhelp.</li> |
Daniel Veillard | 33b20b7 | 2005-09-12 21:43:20 +0000 | [diff] [blame] | 834 | </ul> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 835 | |
Daniel Veillard | b3d1491 | 2005-09-04 20:47:39 +0000 | [diff] [blame] | 836 | <h3>2.6.21: Sep 4 2005</h3> |
| 837 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 838 | <li>build fixes: Cygwin portability fixes (Gerrit P. Haase), |
| 839 | callingconvention problems on Windows (Marcus Boerger), cleanups based on |
| 840 | Linus'sparse tool, update of win32/configure.js (Rob Richards), remove |
| 841 | warningson Windows(Marcus Boerger), compilation without SAX1, detection |
| 842 | of thePython binary, use $GCC inestad of $CC = 'gcc' (Andrew W. |
| 843 | Nosenko),compilation/link with threads and old gcc, compile problem by |
| 844 | C370 onZ/OS,</li> |
| 845 | <li>bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8bug |
| 846 | (Jiri Netolicky), XPath NaN compare bug (William Brack),htmlParseScript |
| 847 | potential bug, Schemas regexp handling of spaces, Base64Schemas |
| 848 | comparisons NIST passes, automata build error xsd:all,xmlGetNodePath for |
| 849 | namespaced attributes (Alexander Pohoyda), xmlSchemasforeign namespaces |
| 850 | handling, XML Schemas facet comparison (KupriyanovAnatolij), |
| 851 | xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml:namespace |
| 852 | ahndling in Schemas (Kasimier), empty model group in Schemas(Kasimier), |
| 853 | wilcard in Schemas (Kasimier), URI composition (William),xs:anyType in |
| 854 | Schemas (Kasimier), Python resolver emmitting errormessages directly, |
| 855 | Python xmlAttr.parent (Jakub Piotr Clapa), trying tofix the file path/URI |
| 856 | conversion, xmlTextReaderGetAttribute fix (RobRichards), |
| 857 | xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8serialization, streaming |
| 858 | XPath, Schemas determinism detection problem,XInclude bug, Schemas |
| 859 | context type (Dean Hill), validation fix (DerekPoon), |
| 860 | xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), Schemastype fix |
| 861 | (Kuba Nowakowski), UTF-8 parser bug, error in encoding |
| 862 | handling,xmlGetLineNo fixes, bug on entities handling, entity name |
| 863 | extraction inerror handling with XInclude, text nodes in HTML body tags |
| 864 | (Gary Coady),xml:id and IDness at the treee level fixes, XPath streaming |
| 865 | patternsbugs.</li> |
| 866 | <li>improvements: structured interfaces for schemas and RNG error |
| 867 | reports(Marcus Boerger), optimization of the char data inner loop |
| 868 | parsing(thanks to Behdad Esfahbod for the idea), schematron validation |
| 869 | thoughnot finished yet, xmlSaveOption to omit XML declaration, keyref |
| 870 | matcherror reports (Kasimier), formal expression handling code not |
| 871 | pluggedyet, more lax mode for the HTML parser, parser XML_PARSE_COMPACT |
| 872 | optionfor text nodes allocation.</li> |
Daniel Veillard | b3d1491 | 2005-09-04 20:47:39 +0000 | [diff] [blame] | 873 | <li>documentation: xmllint man page had --nonet duplicated</li> |
| 874 | </ul> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 875 | |
Daniel Veillard | 78dfc9f | 2005-07-10 22:30:30 +0000 | [diff] [blame] | 876 | <h3>2.6.20: Jul 10 2005</h3> |
| 877 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 878 | <li>build fixes: Windows build (Rob Richards), Mingw compilation |
| 879 | (IgorZlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier |
| 880 | andandriy@google.com), use gcc weak references to pthread to avoid |
| 881 | thepthread dependancy on Linux, compilation problem (Steve Nairn), |
| 882 | compilingof subset (Morten Welinder), IPv6/ss_family compilation (William |
| 883 | Brack),compilation when disabling parts of the library, standalone |
| 884 | testdistribution.</li> |
| 885 | <li>bug fixes: bug in lang(), memory cleanup on errors (William Brack),HTTP |
| 886 | query strings (Aron Stansvik), memory leak in DTD (William), |
| 887 | integeroverflow in XPath (William), nanoftp buffer size, pattern "." apth |
| 888 | fixup(Kasimier), leak in tree reported by Malcolm Rowe, replaceNode |
| 889 | patch(Brent Hendricks), CDATA with NULL content (Mark Vakoc), xml:base |
| 890 | fixupon XInclude (William), pattern fixes (William), attribute bug |
| 891 | inexclusive c14n (Aleksey Sanin), xml:space and xml:lang with SAX2 |
| 892 | (RobRichards), namespace trouble in complex parsing (Malcolm Rowe), XSD |
| 893 | typeQNames fixes (Kasimier), XPath streaming fixups (William), RelaxNG |
| 894 | bug(Rob Richards), Schemas for Schemas fixes (Kasimier), removal of ID |
| 895 | (RobRichards), a small RelaxNG leak, HTML parsing in push mode bug |
| 896 | (JamesBursa), failure to detect UTF-8 parsing bugs in CDATA |
| 897 | sections,areBlanks() heuristic failure, duplicate attributes in DTD |
| 898 | bug(William).</li> |
| 899 | <li>improvements: lot of work on Schemas by Kasimier Buchcik both |
| 900 | onconformance and streaming, Schemas validation messages (Kasimier |
| 901 | Buchcik,Matthew Burgess), namespace removal at the python level |
| 902 | (BrentHendricks), Update to new Schemas regression tests from |
| 903 | W3C/Nist(Kasimier), xmlSchemaValidateFile() (Kasimier), implementation |
| 904 | ofxmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James |
| 905 | Wert),standalone test framework and programs, new DOM import |
| 906 | APIsxmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() |
| 907 | andxmlDOMWrapRemoveNode(), extension of xmllint capabilities for SAX |
| 908 | andSchemas regression tests, xmlStopParser() available in pull mode |
| 909 | too,ienhancement to xmllint --shell namespaces support, Windows port of |
| 910 | thestandalone testing tools (Kasimier and |
| 911 | William),xmlSchemaValidateStream() xmlSchemaSAXPlug() and |
| 912 | xmlSchemaSAXUnplug() SAXSchemas APIs, Schemas xmlReader support.</li> |
Daniel Veillard | 78dfc9f | 2005-07-10 22:30:30 +0000 | [diff] [blame] | 913 | </ul> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 914 | |
Daniel Veillard | 771971f | 2005-04-02 10:49:51 +0000 | [diff] [blame] | 915 | <h3>2.6.19: Apr 02 2005</h3> |
| 916 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 917 | <li>build fixes: drop .la from RPMs, --with-minimum build fix |
| 918 | (WilliamBrack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks |
| 919 | with AIX5.3 compiler, fixed elfgcchack.h generation and PLT reduction |
| 920 | code onLinux/ELF/gcc4</li> |
| 921 | <li>bug fixes: schemas type decimal fixups (William Brack), xmmlint |
| 922 | returncode (Gerry Murphy), small schemas fixes (Matthew Burgess and |
| 923 | GUYFabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey |
| 924 | Sanin),segfault in Schemas (Kasimier Buchcik), Schemas attribute |
| 925 | validation(Kasimier), Prop related functions and xmlNewNodeEatName (Rob |
| 926 | Richards),HTML serialization of name attribute on a elements, Python |
| 927 | error handlersleaks and improvement (Brent Hendricks), uninitialized |
| 928 | variable inencoding code, Relax-NG validation bug, potential crash |
| 929 | ifgnorableWhitespace is NULL, xmlSAXParseDoc and xmlParseDoc |
| 930 | signatures,switched back to assuming UTF-8 in case no encoding is given |
| 931 | atserialization time</li> |
| 932 | <li>improvements: lot of work on Schemas by Kasimier Buchcik on |
| 933 | facetschecking and also mixed handling.</li> |
Daniel Veillard | 771971f | 2005-04-02 10:49:51 +0000 | [diff] [blame] | 934 | <li></li> |
| 935 | </ul> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 936 | |
Daniel Veillard | 57c000e | 2005-03-13 18:34:29 +0000 | [diff] [blame] | 937 | <h3>2.6.18: Mar 13 2005</h3> |
| 938 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 939 | <li>build fixes: warnings (Peter Breitenlohner), testapi.c |
| 940 | generation,Bakefile support (Francesco Montorsi), Windows compilation |
| 941 | (Joel Reed),some gcc4 fixes, HP-UX portability fixes (Rick Jones).</li> |
| 942 | <li>bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push |
| 943 | andxmlreader stopping on non-fatal errors, thread support for |
| 944 | dictionnariesreference counting (Gary Coady), internal subset and push |
| 945 | problem, URLsaved in xmlCopyDoc, various schemas bug fixes (Kasimier), |
| 946 | Python pathsfixup (Stephane Bidoul), xmlGetNodePath and namespaces, |
| 947 | xmlSetNsProp fix(Mike Hommey), warning should not count as error (William |
| 948 | Brack),xmlCreatePushParser empty chunk, XInclude parser flags (William), |
| 949 | cleanupFTP and HTTP code to reuse the uri parsing and IPv6 |
| 950 | (William),xmlTextWriterStartAttributeNS fix (Rob Richards), |
| 951 | XMLLINT_INDENT beingempty (William), xmlWriter bugs (Rob Richards), |
| 952 | multithreading on Windows(Rich Salz), xmlSearchNsByHref fix (Kasimier), |
| 953 | Python binding leak (BrentHendricks), aliasing bug exposed by gcc4 on |
| 954 | s390, xmlTextReaderNext bug(Rob Richards), Schemas decimal type fixes |
| 955 | (William Brack),xmlByteConsumed static buffer (Ben Maurer).</li> |
| 956 | <li>improvement: speedup parsing comments and DTDs, dictionnary support |
| 957 | forhash tables, Schemas Identity constraints (Kasimier), streaming |
| 958 | XPathsubset, xmlTextReaderReadString added (Bjorn Reese), Schemas |
| 959 | canonicalvalues handling (Kasimier), add xmlTextReaderByteConsumed |
| 960 | (AronStansvik),</li> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 961 | <li>Documentation: Wiki support (Joel Reed)</li> |
Daniel Veillard | 57c000e | 2005-03-13 18:34:29 +0000 | [diff] [blame] | 962 | </ul> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 963 | |
Daniel Veillard | 298d964 | 2005-01-16 20:01:55 +0000 | [diff] [blame] | 964 | <h3>2.6.17: Jan 16 2005</h3> |
| 965 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 966 | <li>build fixes: Windows, warnings removal (William Brack),maintainer-clean |
| 967 | dependency(William), build in a different directory(William), fixing |
| 968 | --with-minimum configure build (William), BeOS build(Marcin Konicki), |
| 969 | Python-2.4 detection (William), compilation on AIX (DanMcNichol)</li> |
| 970 | <li>bug fixes: xmlTextReaderHasAttributes (Rob Richards), |
| 971 | xmlCtxtReadFile()to use the catalog(s), loop on output (William Brack), |
| 972 | XPath memory leak,ID deallocation problem (Steve Shepard), debugDumpNode |
| 973 | crash (William),warning not using error callback (William), xmlStopParser |
| 974 | bug (William),UTF-16 with BOM on DTDs (William), namespace bug on empty |
| 975 | elements inpush mode (Rob Richards), line and col computations fixups |
| 976 | (AlekseySanin), xmlURIEscape fix (William), xmlXPathErr on bad range |
| 977 | (William),patterns with too many steps, bug in RNG choice optimization, |
| 978 | line numbersometimes missing.</li> |
| 979 | <li>improvements: XSD Schemas (Kasimier Buchcik), python |
| 980 | generator(William), xmlUTF8Strpos speedup (William), unicode Python |
| 981 | strings(William), XSD error reports (Kasimier Buchcik), Python __str__ |
| 982 | callserialize().</li> |
| 983 | <li>new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber |
| 984 | forthe xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs (mostly |
| 985 | JoelReed), error extraction API from regexps, new XMLSave option for |
| 986 | format(Phil Shafer)</li> |
| 987 | <li>documentation: site improvement (John Fleck), FAQ entries(William).</li> |
Daniel Veillard | 298d964 | 2005-01-16 20:01:55 +0000 | [diff] [blame] | 988 | </ul> |
| 989 | |
Daniel Veillard | c3d7cb4 | 2004-11-10 14:34:45 +0000 | [diff] [blame] | 990 | <h3>2.6.16: Nov 10 2004</h3> |
| 991 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 992 | <li>general hardening and bug fixing crossing all the API based on |
| 993 | newautomated regression testing</li> |
Daniel Veillard | c3d7cb4 | 2004-11-10 14:34:45 +0000 | [diff] [blame] | 994 | <li>build fix: IPv6 build and test on AIX (Dodji Seketeli)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 995 | <li>bug fixes: problem with XML::Libxml reported by Petr Pajas, |
| 996 | encodingconversion functions return values, UTF-8 bug affecting XPath |
| 997 | reported byMarkus Bertheau, catalog problem with NULL entries (William |
| 998 | Brack)</li> |
| 999 | <li>documentation: fix to xmllint man page, some API function |
| 1000 | descritpionwere updated.</li> |
| 1001 | <li>improvements: DTD validation APIs provided at the Python level |
| 1002 | (BrentHendricks)</li> |
Daniel Veillard | c3d7cb4 | 2004-11-10 14:34:45 +0000 | [diff] [blame] | 1003 | </ul> |
| 1004 | |
Daniel Veillard | c2f83d1 | 2004-10-27 22:59:21 +0000 | [diff] [blame] | 1005 | <h3>2.6.15: Oct 27 2004</h3> |
Daniel Veillard | 6927b10 | 2004-10-27 17:29:04 +0000 | [diff] [blame] | 1006 | <ul> |
| 1007 | <li>security fixes on the nanoftp and nanohttp modules</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1008 | <li>build fixes: xmllint detection bug in configure, building outside |
| 1009 | thesource tree (Thomas Fitzsimmons)</li> |
| 1010 | <li>bug fixes: HTML parser on broken ASCII chars in names (William), |
| 1011 | Pythonpaths (Malcolm Tredinnick), xmlHasNsProp and default namespace |
| 1012 | (William),saving to python file objects (Malcolm Tredinnick), DTD lookup |
| 1013 | fix(Malcolm), save back <group> in catalogs (William), tree |
| 1014 | buildfixes (DV and Rob Richards), Schemas memory bug, structured error |
| 1015 | handleron Python 64bits, thread local memory deallocation, memory leak |
| 1016 | reportedby Volker Roth, xmlValidateDtd in the presence of an internal |
| 1017 | subset,entities and _private problem (William), xmlBuildRelativeURI |
| 1018 | error(William).</li> |
| 1019 | <li>improvements: better XInclude error reports (William), tree |
| 1020 | debuggingmodule and tests, convenience functions at the Reader API |
| 1021 | (GrahamBennett), add support for PI in the HTML parser.</li> |
Daniel Veillard | 6927b10 | 2004-10-27 17:29:04 +0000 | [diff] [blame] | 1022 | </ul> |
| 1023 | |
Daniel Veillard | 210818b | 2004-09-29 15:50:37 +0000 | [diff] [blame] | 1024 | <h3>2.6.14: Sep 29 2004</h3> |
| 1025 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1026 | <li>build fixes: configure paths for xmllint and xsltproc, |
| 1027 | compilationwithout HTML parser, compilation warning cleanups (William |
| 1028 | Brack &Malcolm Tredinnick), VMS makefile update (Craig Berry),</li> |
| 1029 | <li>bug fixes: xmlGetUTF8Char (William Brack), QName properties |
| 1030 | (KasimierBuchcik), XInclude testing, Notation serialization, |
| 1031 | UTF8ToISO8859xtranscoding (Mark Itzcovitz), lots of XML Schemas cleanup |
| 1032 | and fixes(Kasimier), ChangeLog cleanup (Stepan Kasal), memory fixes (Mark |
| 1033 | Vakoc),handling of failed realloc(), out of bound array adressing in |
| 1034 | Schemasdate handling, Python space/tabs cleanups (Malcolm Tredinnick), |
| 1035 | NMTOKENSE20 validation fix (Malcolm),</li> |
| 1036 | <li>improvements: added W3C XML Schemas testsuite (Kasimier Buchcik), |
| 1037 | addxmlSchemaValidateOneElement (Kasimier), Python exception |
| 1038 | hierearchy(Malcolm Tredinnick), Python libxml2 driver improvement |
| 1039 | (MalcolmTredinnick), Schemas support for |
| 1040 | xsi:schemaLocation,xsi:noNamespaceSchemaLocation, xsi:type (Kasimier |
| 1041 | Buchcik)</li> |
Daniel Veillard | 210818b | 2004-09-29 15:50:37 +0000 | [diff] [blame] | 1042 | </ul> |
| 1043 | |
Daniel Veillard | d1de4a3 | 2004-08-31 13:43:07 +0000 | [diff] [blame] | 1044 | <h3>2.6.13: Aug 31 2004</h3> |
| 1045 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1046 | <li>build fixes: Windows and zlib (Igor Zlatkovic), -O flag with |
| 1047 | gcc,Solaris compiler warning, fixing RPM BuildRequires,</li> |
| 1048 | <li>fixes: DTD loading on Windows (Igor), Schemas error reports |
| 1049 | APIs(Kasimier Buchcik), Schemas validation crash, xmlCheckUTF8 (William |
| 1050 | Brackand Julius Mittenzwei), Schemas facet check (Kasimier), default |
| 1051 | namespaceproblem (William), Schemas hexbinary empty values, encoding |
| 1052 | error couldgenrate a serialization loop.</li> |
| 1053 | <li>Improvements: Schemas validity improvements (Kasimier), added --pathand |
| 1054 | --load-trace options to xmllint</li> |
Daniel Veillard | d1de4a3 | 2004-08-31 13:43:07 +0000 | [diff] [blame] | 1055 | <li>documentation: tutorial update (John Fleck)</li> |
| 1056 | </ul> |
| 1057 | |
Daniel Veillard | b331fff | 2004-08-22 14:21:57 +0000 | [diff] [blame] | 1058 | <h3>2.6.12: Aug 22 2004</h3> |
| 1059 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1060 | <li>build fixes: fix --with-minimum, elfgcchack.h fixes |
| 1061 | (PeterBreitenlohner), perl path lookup (William), diff on Solaris |
| 1062 | (AlbertChin), some 64bits cleanups.</li> |
| 1063 | <li>Python: avoid a warning with 2.3 (William Brack), tab and space |
| 1064 | mixes(William), wrapper generator fixes (William), Cygwin support (Gerrit |
| 1065 | P.Haase), node wrapper fix (Marc-Antoine Parent), XML Schemas |
| 1066 | support(Torkel Lyng)</li> |
Daniel Veillard | b331fff | 2004-08-22 14:21:57 +0000 | [diff] [blame] | 1067 | <li>Schemas: a lot of bug fixes and improvements from Kasimier Buchcik</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1068 | <li>fixes: RVT fixes (William), XPath context resets bug (William), |
| 1069 | memorydebug (Steve Hay), catalog white space handling (Peter |
| 1070 | Breitenlohner),xmlReader state after attribute reading (William), |
| 1071 | structured errorhandler (William), XInclude generated xml:base fixup |
| 1072 | (William), Windowsmemory reallocation problem (Steve Hay), Out of Memory |
| 1073 | conditionshandling (William and Olivier Andrieu), htmlNewDoc() charset |
| 1074 | bug,htmlReadMemory init (William), a posteriori validation DTD |
| 1075 | base(William), notations serialization missing, xmlGetNodePath |
| 1076 | (Dodji),xmlCheckUTF8 (Diego Tartara), missing line numbers on |
| 1077 | entity(William)</li> |
| 1078 | <li>improvements: DocBook catalog build scrip (William), xmlcatalog |
| 1079 | tool(Albert Chin), xmllint --c14n option, no_proxy environment (Mike |
| 1080 | Hommey),xmlParseInNodeContext() addition, extend xmllint --shell, allow |
| 1081 | XIncludeto not generate start/end nodes, extend xmllint --version to |
| 1082 | include CVStag (William)</li> |
| 1083 | <li>documentation: web pages fixes, validity API docs fixes |
| 1084 | (William)schemas API fix (Eric Haszlakiewicz), xmllint man page (John |
| 1085 | Fleck)</li> |
Daniel Veillard | b331fff | 2004-08-22 14:21:57 +0000 | [diff] [blame] | 1086 | </ul> |
| 1087 | |
Daniel Veillard | 45cb0f4 | 2004-07-05 17:45:35 +0000 | [diff] [blame] | 1088 | <h3>2.6.11: July 5 2004</h3> |
| 1089 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1090 | <li>Schemas: a lot of changes and improvements by Kasimier Buchcik |
| 1091 | forattributes, namespaces and simple types.</li> |
| 1092 | <li>build fixes: --with-minimum (William Brack), some gcc |
| 1093 | cleanup(William), --with-thread-alloc (William)</li> |
| 1094 | <li>portability: Windows binary package change (Igor Zlatkovic), |
| 1095 | Catalogpath on Windows</li> |
| 1096 | <li>documentation: update to the tutorial (John Fleck), xmllint return |
| 1097 | code(John Fleck), man pages (Ville Skytta),</li> |
| 1098 | <li>bug fixes: C14N bug serializing namespaces (Aleksey Sanin), |
| 1099 | testSAXproperly initialize the library (William), empty node set in |
| 1100 | XPath(William), xmlSchemas errors (William), invalid charref problem |
| 1101 | pointedby Morus Walter, XInclude xml:base generation (William), Relax-NG |
| 1102 | bugwith div processing (William), XPointer and xml:base |
| 1103 | problem(William),Reader and entities, xmllint return code for schemas |
| 1104 | (William), readerstreaming problem (Steve Ball), DTD serialization |
| 1105 | problem (William),libxml.m4 fixes (Mike Hommey), do not provide |
| 1106 | destructors as methods onPython classes, xmlReader buffer bug, Python |
| 1107 | bindings memory interfacesimprovement (with Stéphane Bidoul), Fixed the |
| 1108 | push parser to be back tosynchronous behaviour.</li> |
| 1109 | <li>improvement: custom per-thread I/O enhancement (Rob Richards), |
| 1110 | registernamespace in debug shell (Stefano Debenedetti), Python based |
| 1111 | regressiontest for non-Unix users (William), dynamically increase the |
| 1112 | number ofXPath extension functions in Python and fix a memory leak |
| 1113 | (Marc-AntoineParent and William)</li> |
| 1114 | <li>performance: hack done with Arjan van de Ven to reduce ELF footprintand |
| 1115 | generated code on Linux, plus use gcc runtime profiling to optimizethe |
| 1116 | code generated in the RPM packages.</li> |
Daniel Veillard | 45cb0f4 | 2004-07-05 17:45:35 +0000 | [diff] [blame] | 1117 | </ul> |
| 1118 | |
Daniel Veillard | 8120501 | 2004-05-18 03:06:41 +0000 | [diff] [blame] | 1119 | <h3>2.6.10: May 17 2004</h3> |
| 1120 | <ul> |
| 1121 | <li>Web page generated for ChangeLog</li> |
| 1122 | <li>build fixes: --without-html problems, make check without make all</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1123 | <li>portability: problem with xpath.c on Windows (MSC and Borland), |
| 1124 | memcmpvs. strncmp on Solaris, XPath tests on Windows (Mark Vakoc), C++ do |
| 1125 | notuse "list" as parameter name, make tests work with Python 1.5 |
| 1126 | (EdDavis),</li> |
| 1127 | <li>improvements: made xmlTextReaderMode public, small buffers |
| 1128 | resizing(Morten Welinder), add --maxmem option to xmllint, |
| 1129 | addxmlPopInputCallback() for Matt Sergeant, refactoring of |
| 1130 | serializationescaping, added escaping customization</li> |
| 1131 | <li>bugfixes: xsd:extension (Taihei Goi), assorted regexp bugs |
| 1132 | (WilliamBrack), xmlReader end of stream problem, node deregistration with |
| 1133 | reader,URI escaping and filemanes, XHTML1 formatting (Nick Wellnhofer), |
| 1134 | regexptransition reduction (William), various XSD Schemas fixes |
| 1135 | (KasimierBuchcik), XInclude fallback problem (William), weird problems |
| 1136 | with DTD(William), structured error handler callback context (William), |
| 1137 | reversexmlEncodeSpecialChars() behaviour back to escaping '"'</li> |
Daniel Veillard | 8120501 | 2004-05-18 03:06:41 +0000 | [diff] [blame] | 1138 | </ul> |
| 1139 | |
Daniel Veillard | eca726d | 2004-04-18 21:47:34 +0000 | [diff] [blame] | 1140 | <h3>2.6.9: Apr 18 2004</h3> |
| 1141 | <ul> |
| 1142 | <li>implement xml:id Working Draft, relaxed XPath id() checking</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1143 | <li>bugfixes: xmlCtxtReset (Brent Hendricks), line number and CDATA |
| 1144 | (DaveBeckett), Relax-NG compilation (William Brack), Regexp patches |
| 1145 | (withWilliam), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem |
| 1146 | (withWilliam), Relax-NG name classes compares (William), XInclude |
| 1147 | duplicatefallback (William), external DTD encoding detection (William), a |
| 1148 | DTDvalidation bug (William), xmlReader Close() fix, recusive |
| 1149 | extentionschemas</li> |
| 1150 | <li>improvements: use xmlRead* APIs in test tools (Mark Vakoc), |
| 1151 | indentingsave optimization, better handle IIS broken HTTP redirect |
| 1152 | behaviour (IanHummel), HTML parser frameset (James Bursa), libxml2-python |
| 1153 | RPMdependancy, XML Schemas union support (Kasimier Buchcik), warning |
| 1154 | removalclanup (William), keep ChangeLog compressed when installing from |
| 1155 | RPMs</li> |
| 1156 | <li>documentation: examples and xmlDocDumpMemory docs (John Fleck), |
| 1157 | newexample (load, xpath, modify, save), xmlCatalogDump() comments,</li> |
| 1158 | <li>Windows: Borland C++ builder (Eric Zurcher), work around |
| 1159 | Microsoftcompiler NaN handling bug (Mark Vakoc)</li> |
Daniel Veillard | eca726d | 2004-04-18 21:47:34 +0000 | [diff] [blame] | 1160 | </ul> |
| 1161 | |
Daniel Veillard | 252004d | 2004-03-23 12:32:32 +0000 | [diff] [blame] | 1162 | <h3>2.6.8: Mar 23 2004</h3> |
| 1163 | <ul> |
| 1164 | <li>First step of the cleanup of the serialization code and APIs</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1165 | <li>XML Schemas: mixed content (Adam Dickmeiss), QName handling fixes |
| 1166 | (AdamDickmeiss), anyURI for "" (John Belmonte)</li> |
Daniel Veillard | 252004d | 2004-03-23 12:32:32 +0000 | [diff] [blame] | 1167 | <li>Python: Canonicalization C14N support added (Anthony Carrico)</li> |
| 1168 | <li>xmlDocCopyNode() extension (William)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1169 | <li>Relax-NG: fix when processing XInclude results (William), |
| 1170 | externalreference in interleave (William), missing error on |
| 1171 | <choice>failure (William), memory leak in schemas datatype |
| 1172 | facets.</li> |
Daniel Veillard | 252004d | 2004-03-23 12:32:32 +0000 | [diff] [blame] | 1173 | <li>xmlWriter: patch for better DTD support (Alfred Mickautsch)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1174 | <li>bug fixes: xmlXPathLangFunction memory leak (Mike Hommey and |
| 1175 | WilliamBrack), no ID errors if using HTML_PARSE_NOERROR, xmlcatalog |
| 1176 | fallbacks toURI on SYSTEM lookup failure, XInclude parse flags |
| 1177 | inheritance (William),XInclude and XPointer fixes for entities (William), |
| 1178 | XML parser bugreported by Holger Rauch, nanohttp fd leak (William), |
| 1179 | regexps chargroups '-' handling (William), dictionnary reference counting |
| 1180 | problems,do not close stderr.</li> |
Daniel Veillard | 252004d | 2004-03-23 12:32:32 +0000 | [diff] [blame] | 1181 | <li>performance patches from Petr Pajas</li> |
| 1182 | <li>Documentation fixes: XML_CATALOG_FILES in man pages (Mike Hommey)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1183 | <li>compilation and portability fixes: --without-valid, catalog |
| 1184 | cleanups(Peter Breitenlohner), MingW patch (Roland Schwingel), |
| 1185 | cross-compilationto Windows (Christophe de Vienne), --with-html-dir |
| 1186 | fixup (Julio MerinoVidal), Windows build (Eric Zurcher)</li> |
Daniel Veillard | 252004d | 2004-03-23 12:32:32 +0000 | [diff] [blame] | 1187 | </ul> |
| 1188 | |
Daniel Veillard | 9291449 | 2004-02-23 16:33:21 +0000 | [diff] [blame] | 1189 | <h3>2.6.7: Feb 23 2004</h3> |
| 1190 | <ul> |
| 1191 | <li>documentation: tutorial updates (John Fleck), benchmark results</li> |
| 1192 | <li>xmlWriter: updates and fixes (Alfred Mickautsch, Lucas Brasilino)</li> |
| 1193 | <li>XPath optimization (Petr Pajas)</li> |
| 1194 | <li>DTD ID handling optimization</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1195 | <li>bugfixes: xpath number with > 19 fractional (William Brack), |
| 1196 | pushmode with unescaped '>' characters, fix xmllint --stream --timing, |
| 1197 | fixxmllint --memory --stream memory usage, |
| 1198 | xmlAttrSerializeTxtContenthandling NULL, trying to fix Relax-NG/Perl |
| 1199 | interface.</li> |
Daniel Veillard | 9291449 | 2004-02-23 16:33:21 +0000 | [diff] [blame] | 1200 | <li>python: 2.3 compatibility, whitespace fixes (Malcolm Tredinnick)</li> |
| 1201 | <li>Added relaxng option to xmllint --shell</li> |
| 1202 | </ul> |
| 1203 | |
Daniel Veillard | 5c9547e | 2004-02-12 15:31:49 +0000 | [diff] [blame] | 1204 | <h3>2.6.6: Feb 12 2004</h3> |
| 1205 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1206 | <li>nanohttp and nanoftp: buffer overflow error on URI parsing (Igor |
| 1207 | andWilliam) reported by Yuuichi Teranishi</li> |
| 1208 | <li>bugfixes: make test and path issues, xmlWriter attribute |
| 1209 | serialization(William Brack), xmlWriter indentation (William), schemas |
| 1210 | validation(Eric Haszlakiewicz), XInclude dictionnaries issues (William |
| 1211 | and OlegParaschenko), XInclude empty fallback (William), HTML warnings |
| 1212 | (William),XPointer in XInclude (William), Python namespace |
| 1213 | serialization,isolat1ToUTF8 bound error (Alfred Mickautsch), output of |
| 1214 | parameterentities in internal subset (William), internal subset bug in |
| 1215 | push mode,<xs:all> fix (Alexey Sarytchev)</li> |
| 1216 | <li>Build: fix for automake-1.8 (Alexander Winston), warnings |
| 1217 | removal(Philip Ludlam), SOCKLEN_T detection fixes (Daniel Richard), |
| 1218 | fix--with-minimum configuration.</li> |
Daniel Veillard | 5c9547e | 2004-02-12 15:31:49 +0000 | [diff] [blame] | 1219 | <li>XInclude: allow the 2001 namespace without warning.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1220 | <li>Documentation: missing example/index.html (John Fleck), |
| 1221 | versiondependancies (John Fleck)</li> |
Daniel Veillard | 5c9547e | 2004-02-12 15:31:49 +0000 | [diff] [blame] | 1222 | <li>reader API: structured error reporting (Steve Ball)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1223 | <li>Windows compilation: mingw, msys (Mikhail Grushinskiy), |
| 1224 | functionprototype (Cameron Johnson), MSVC6 compiler warnings, |
| 1225 | _WINSOCKAPI_patch</li> |
| 1226 | <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offest |
| 1227 | ininput.</li> |
Daniel Veillard | 5c9547e | 2004-02-12 15:31:49 +0000 | [diff] [blame] | 1228 | </ul> |
| 1229 | |
Daniel Veillard | 189f46b | 2004-01-25 21:03:04 +0000 | [diff] [blame] | 1230 | <h3>2.6.5: Jan 25 2004</h3> |
| 1231 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1232 | <li>Bugfixes: dictionnaries for schemas (William Brack), regexp |
| 1233 | segfault(William), xs:all problem (William), a number of XPointer |
| 1234 | bugfixes(William), xmllint error go to stderr, DTD validation problem |
| 1235 | withnamespace, memory leak (William), SAX1 cleanup and minimal options |
| 1236 | fixes(Mark Vadoc), parser context reset on error (Shaun McCance), XPath |
| 1237 | unionevaluation problem (William) , xmlReallocLoc with NULL (Aleksey |
| 1238 | Sanin),XML Schemas double free (Steve Ball), XInclude with no href, |
| 1239 | argumentcallbacks order for XPath callbacks (Frederic Peters)</li> |
| 1240 | <li>Documentation: python scripts (William Brack), xslt stylesheets |
| 1241 | (JohnFleck), doc (Sven Zimmerman), I/O example.</li> |
| 1242 | <li>Python bindings: fixes (William), enum support (Stéphane |
| 1243 | Bidoul),structured error reporting (Stéphane Bidoul)</li> |
| 1244 | <li>XInclude: various fixes for conformance, problem related to |
| 1245 | dictionnaryreferences (William & me), recursion (William)</li> |
| 1246 | <li>xmlWriter: indentation (Lucas Brasilino), memory leaks |
| 1247 | (AlfredMickautsch),</li> |
Daniel Veillard | 189f46b | 2004-01-25 21:03:04 +0000 | [diff] [blame] | 1248 | <li>xmlSchemas: normalizedString datatype (John Belmonte)</li> |
| 1249 | <li>code cleanup for strings functions (William)</li> |
| 1250 | <li>Windows: compiler patches (Mark Vakoc)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1251 | <li>Parser optimizations, a few new XPath and dictionnary APIs for |
| 1252 | futureXSLT optimizations.</li> |
Daniel Veillard | 189f46b | 2004-01-25 21:03:04 +0000 | [diff] [blame] | 1253 | </ul> |
| 1254 | |
Daniel Veillard | e6e59cd | 2003-12-24 11:56:44 +0000 | [diff] [blame] | 1255 | <h3>2.6.4: Dec 24 2003</h3> |
| 1256 | <ul> |
| 1257 | <li>Windows build fixes (Igor Zlatkovic)</li> |
Daniel Veillard | 189f46b | 2004-01-25 21:03:04 +0000 | [diff] [blame] | 1258 | <li>Some serious XInclude problems reported by Oleg Paraschenko and</li> |
| 1259 | <li>Unix and Makefile packaging fixes (me, William Brack,</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1260 | <li>Documentation improvements (John Fleck, William Brack), example |
| 1261 | fix(Lucas Brasilino)</li> |
| 1262 | <li>bugfixes: xmlTextReaderExpand() with xmlReaderWalker, XPath handling |
| 1263 | ofNULL strings (William Brack) , API building reader or parser |
| 1264 | fromfiledescriptor should not close it, changed XPath sorting to be |
| 1265 | stableagain (William Brack), xmlGetNodePath() generating '(null)' |
| 1266 | (WilliamBrack), DTD validation and namespace bug (William Brack), XML |
| 1267 | Schemasdouble inclusion behaviour</li> |
Daniel Veillard | e6e59cd | 2003-12-24 11:56:44 +0000 | [diff] [blame] | 1268 | </ul> |
| 1269 | |
Daniel Veillard | c480c4e | 2003-12-10 13:24:38 +0000 | [diff] [blame] | 1270 | <h3>2.6.3: Dec 10 2003</h3> |
| 1271 | <ul> |
| 1272 | <li>documentation updates and cleanup (DV, William Brack, John Fleck)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1273 | <li>added a repository of examples, examples from Aleksey Sanin, |
| 1274 | DodjiSeketeli, Alfred Mickautsch</li> |
| 1275 | <li>Windows updates: Mark Vakoc, Igor Zlatkovic, Eric Zurcher, |
| 1276 | Mingw(Kenneth Haley)</li> |
Daniel Veillard | c480c4e | 2003-12-10 13:24:38 +0000 | [diff] [blame] | 1277 | <li>Unicode range checking (William Brack)</li> |
| 1278 | <li>code cleanup (William Brack)</li> |
| 1279 | <li>Python bindings: doc (John Fleck), bug fixes</li> |
| 1280 | <li>UTF-16 cleanup and BOM issues (William Brack)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1281 | <li>bug fixes: ID and xmlReader validation, XPath (William Brack),xmlWriter |
| 1282 | (Alfred Mickautsch), hash.h inclusion problem, HTML parser(James Bursa), |
| 1283 | attribute defaulting and validation, some serializationcleanups, |
| 1284 | XML_GET_LINE macro, memory debug when using threads (WilliamBrack), |
| 1285 | serialization of attributes and entities content, xmlWriter(Daniel |
| 1286 | Schulman)</li> |
| 1287 | <li>XInclude bugfix, new APIs and update to the last version including |
| 1288 | thenamespace change.</li> |
| 1289 | <li>XML Schemas improvements: include (Robert Stepanek), import |
| 1290 | andnamespace handling, fixed the regression tests troubles, added |
| 1291 | examplesbased on Eric van der Vlist book, regexp fixes</li> |
| 1292 | <li>preliminary pattern support for streaming (needed for |
| 1293 | schemasconstraints), added xmlTextReaderPreservePattern() to collect |
| 1294 | subdocumentwhen streaming.</li> |
Daniel Veillard | c480c4e | 2003-12-10 13:24:38 +0000 | [diff] [blame] | 1295 | <li>various fixes in the structured error handling</li> |
| 1296 | </ul> |
| 1297 | |
Daniel Veillard | 6d373a2 | 2003-11-04 10:26:43 +0000 | [diff] [blame] | 1298 | <h3>2.6.2: Nov 4 2003</h3> |
| 1299 | <ul> |
| 1300 | <li>XPath context unregistration fixes</li> |
| 1301 | <li>text node coalescing fixes (Mark Lilback)</li> |
| 1302 | <li>API to screate a W3C Schemas from an existing document (Steve Ball)</li> |
| 1303 | <li>BeOS patches (Marcin 'Shard' Konicki)</li> |
| 1304 | <li>xmlStrVPrintf function added (Aleksey Sanin)</li> |
| 1305 | <li>compilation fixes (Mark Vakoc)</li> |
| 1306 | <li>stdin parsing fix (William Brack)</li> |
| 1307 | <li>a posteriori DTD validation fixes</li> |
Daniel Veillard | c480c4e | 2003-12-10 13:24:38 +0000 | [diff] [blame] | 1308 | <li>xmlReader bug fixes: Walker fixes, python bindings</li> |
Daniel Veillard | 6d373a2 | 2003-11-04 10:26:43 +0000 | [diff] [blame] | 1309 | <li>fixed xmlStopParser() to really stop the parser and errors</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1310 | <li>always generate line numbers when using the new xmlReadxxxfunctions</li> |
Daniel Veillard | 6d373a2 | 2003-11-04 10:26:43 +0000 | [diff] [blame] | 1311 | <li>added XInclude support to the xmlReader interface</li> |
| 1312 | <li>implemented XML_PARSE_NONET parser option</li> |
| 1313 | <li>DocBook XSLT processing bug fixed</li> |
| 1314 | <li>HTML serialization for <p> elements (William Brack and me)</li> |
| 1315 | <li>XPointer failure in XInclude are now handled as resource errors</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1316 | <li>fixed xmllint --html to use the HTML serializer on output |
| 1317 | (added--xmlout to implement the previous behaviour of saving it using the |
| 1318 | XMLserializer)</li> |
Daniel Veillard | 6d373a2 | 2003-11-04 10:26:43 +0000 | [diff] [blame] | 1319 | </ul> |
| 1320 | |
Daniel Veillard | e4e3f5d | 2003-10-28 23:06:32 +0000 | [diff] [blame] | 1321 | <h3>2.6.1: Oct 28 2003</h3> |
| 1322 | <ul> |
| 1323 | <li>Mostly bugfixes after the big 2.6.0 changes</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1324 | <li>Unix compilation patches: libxml.m4 (Patrick Welche), warnings |
| 1325 | cleanup(William Brack)</li> |
| 1326 | <li>Windows compilation patches (Joachim Bauch, Stephane Bidoul, |
| 1327 | IgorZlatkovic)</li> |
Daniel Veillard | e4e3f5d | 2003-10-28 23:06:32 +0000 | [diff] [blame] | 1328 | <li>xmlWriter bugfix (Alfred Mickautsch)</li> |
| 1329 | <li>chvalid.[ch]: couple of fixes from Stephane Bidoul</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1330 | <li>context reset: error state reset, push parser reset (GrahamBennett)</li> |
Daniel Veillard | e4e3f5d | 2003-10-28 23:06:32 +0000 | [diff] [blame] | 1331 | <li>context reuse: generate errors if file is not readable</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1332 | <li>defaulted attributes for element coming from internal entities(Stephane |
| 1333 | Bidoul)</li> |
Daniel Veillard | e4e3f5d | 2003-10-28 23:06:32 +0000 | [diff] [blame] | 1334 | <li>Python: tab and spaces mix (William Brack)</li> |
| 1335 | <li>Error handler could crash in DTD validation in 2.6.0</li> |
| 1336 | <li>xmlReader: do not use the document or element _private field</li> |
| 1337 | <li>testSAX.c: avoid a problem with some PIs (Massimo Morara)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1338 | <li>general bug fixes: mandatory encoding in text decl, serializingDocument |
| 1339 | Fragment nodes, xmlSearchNs 2.6.0 problem (Kasimier Buchcik),XPath errors |
| 1340 | not reported, slow HTML parsing of large documents.</li> |
Daniel Veillard | e4e3f5d | 2003-10-28 23:06:32 +0000 | [diff] [blame] | 1341 | </ul> |
| 1342 | |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 1343 | <h3>2.6.0: Oct 20 2003</h3> |
| 1344 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1345 | <li>Major revision release: should be API and ABI compatible but got a |
| 1346 | lotof change</li> |
| 1347 | <li>Increased the library modularity, far more options can be stripped |
| 1348 | out,a --with-minimum configuration will weight around 160KBytes</li> |
| 1349 | <li>Use per parser and per document dictionnary, allocate names and |
| 1350 | smalltext nodes from the dictionnary</li> |
| 1351 | <li>Switch to a SAX2 like parser rewrote most of the XML parser |
| 1352 | core,provides namespace resolution and defaulted attributes, minimize |
| 1353 | memoryallocations and copies, namespace checking and specific error |
| 1354 | handling,immutable buffers, make predefined entities static structures, |
| 1355 | etc...</li> |
| 1356 | <li>rewrote all the error handling in the library, all errors can |
| 1357 | beintercepted at a structured level, with precise |
| 1358 | informationavailable.</li> |
| 1359 | <li>New simpler and more generic XML and HTML parser APIs, allowing |
| 1360 | toeasilly modify the parsing options and reuse parser context for |
| 1361 | multipleconsecutive documents.</li> |
| 1362 | <li>Similar new APIs for the xmlReader, for options and reuse, provided |
| 1363 | newfunctions to access content as const strings, use them for |
| 1364 | Pythonbindings</li> |
| 1365 | <li>a lot of other smaller API improvements: xmlStrPrintf (Aleksey |
| 1366 | Sanin),Walker i.e. reader on a document tree based on Alfred Mickautsch |
| 1367 | code,make room in nodes for line numbers, reference counting and future |
| 1368 | PSVIextensions, generation of character ranges to be checked with |
| 1369 | fasteralgorithm (William), xmlParserMaxDepth (Crutcher Dunnavant), |
| 1370 | bufferaccess</li> |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 1371 | <li>New xmlWriter API provided by Alfred Mickautsch</li> |
| 1372 | <li>Schemas: base64 support by Anthony Carrico</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1373 | <li>Parser<->HTTP integration fix, proper processing of the |
| 1374 | Mime-Typeand charset informations if available.</li> |
| 1375 | <li>Relax-NG: bug fixes including the one reported by Martijn Faassen |
| 1376 | andzeroOrMore, better error reporting.</li> |
| 1377 | <li>Python bindings (Stéphane Bidoul), never use stdout for |
| 1378 | errorsoutput</li> |
| 1379 | <li>Portability: all the headers have macros for export and |
| 1380 | callingconvention definitions (Igor Zlatkovic), VMS update (Craig A. |
| 1381 | Berry),Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher, |
| 1382 | Igor),Mingw (Igor), typos (Mark Vakoc), beta version (Stephane |
| 1383 | Bidoul),warning cleanups on AIX and MIPS compilers (William Brack), BeOS |
| 1384 | (Marcin'Shard' Konicki)</li> |
| 1385 | <li>Documentation fixes and README (William Brack), search fix |
| 1386 | (William),tutorial updates (John Fleck), namespace docs (Stefan Kost)</li> |
| 1387 | <li>Bug fixes: xmlCleanupParser (Dave Beckett), threading |
| 1388 | uninitializedmutexes, HTML doctype lowercase, SAX/IO (William), |
| 1389 | compression detectionand restore (William), attribute declaration in DTDs |
| 1390 | (William), namespaceon attribute in HTML output (William), input filename |
| 1391 | (Rob Richards),namespace DTD validation, xmlReplaceNode (Chris Ryland), |
| 1392 | I/O callbacks(Markus Keim), CDATA serialization (Shaun McCance), |
| 1393 | xmlReader (PeterDerr), high codepoint charref like &#x10FFFF;, buffer |
| 1394 | access in pushmode (Justin Fletcher), TLS threads on Windows (Jesse |
| 1395 | Pelton), XPath bug(William), xmlCleanupParser (Marc Liyanage), CDATA |
| 1396 | output (William), HTTPerror handling.</li> |
| 1397 | <li>xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for |
| 1398 | compattesting, --nodict for building without tree dictionnary, --nocdata |
| 1399 | toreplace CDATA by text, --nsclean to remove surperfluous |
| 1400 | namespacedeclarations</li> |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 1401 | <li>added xml2-config --libtool-libs option from Kevin P. Fleming</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1402 | <li>a lot of profiling and tuning of the code, speedup patch |
| 1403 | forxmlSearchNs() by Luca Padovani. The xmlReader should do far |
| 1404 | lessallocation and it speed should get closer to SAX. Chris Anderson |
| 1405 | workedon speeding and cleaning up repetitive checking code.</li> |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 1406 | <li>cleanup of "make tests"</li> |
| 1407 | <li>libxml-2.0-uninstalled.pc from Malcolm Tredinnick</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1408 | <li>deactivated the broken docBook SGML parser code and plugged the |
| 1409 | XMLparser instead.</li> |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 1410 | </ul> |
| 1411 | |
Daniel Veillard | eec1ae9 | 2003-09-09 13:11:01 +0000 | [diff] [blame] | 1412 | <h3>2.5.11: Sep 9 2003</h3> |
| 1413 | |
| 1414 | <p>A bugfix only release:</p> |
| 1415 | <ul> |
| 1416 | <li>risk of crash in Relax-NG</li> |
| 1417 | <li>risk of crash when using multithreaded programs</li> |
| 1418 | </ul> |
| 1419 | |
Daniel Veillard | cfba2fe | 2003-08-15 00:33:43 +0000 | [diff] [blame] | 1420 | <h3>2.5.10: Aug 15 2003</h3> |
| 1421 | |
| 1422 | <p>A bugfixes only release</p> |
| 1423 | <ul> |
| 1424 | <li>Windows Makefiles (William Brack)</li> |
| 1425 | <li>UTF-16 support fixes (Mark Itzcovitz)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1426 | <li>Makefile and portability (William Brack) automake, Linux alpha, Mingwon |
| 1427 | Windows (Mikhail Grushinskiy)</li> |
Daniel Veillard | cfba2fe | 2003-08-15 00:33:43 +0000 | [diff] [blame] | 1428 | <li>HTML parser (Oliver Stoeneberg)</li> |
| 1429 | <li>XInclude performance problem reported by Kevin Ruscoe</li> |
| 1430 | <li>XML parser performance problem reported by Grant Goodale</li> |
| 1431 | <li>xmlSAXParseDTD() bug fix from Malcolm Tredinnick</li> |
Daniel Veillard | eec1ae9 | 2003-09-09 13:11:01 +0000 | [diff] [blame] | 1432 | <li>and a couple other cleanup</li> |
Daniel Veillard | cfba2fe | 2003-08-15 00:33:43 +0000 | [diff] [blame] | 1433 | </ul> |
| 1434 | |
Daniel Veillard | 83ee40d | 2003-08-09 22:24:09 +0000 | [diff] [blame] | 1435 | <h3>2.5.9: Aug 9 2003</h3> |
| 1436 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1437 | <li>bugfixes: IPv6 portability, xmlHasNsProp (Markus Keim), Windows |
| 1438 | build(Wiliam Brake, Jesse Pelton, Igor), Schemas (Peter Sobisch), |
| 1439 | threading(Rob Richards), hexBinary type (), UTF-16 BOM (Dodji |
| 1440 | Seketeli),xmlReader, Relax-NG schemas compilation, namespace handling, |
| 1441 | EXSLT (SeanGriffin), HTML parsing problem (William Brack), DTD validation |
| 1442 | for mixedcontent + namespaces, HTML serialization, library |
| 1443 | initialization,progressive HTML parser</li> |
Daniel Veillard | 83ee40d | 2003-08-09 22:24:09 +0000 | [diff] [blame] | 1444 | <li>better interfaces for Relax-NG error handling (Joachim Bauch, )</li> |
| 1445 | <li>adding xmlXIncludeProcessTree() for XInclud'ing in a subtree</li> |
| 1446 | <li>doc fixes and improvements (John Fleck)</li> |
| 1447 | <li>configure flag for -with-fexceptions when embedding in C++</li> |
| 1448 | <li>couple of new UTF-8 helper functions (William Brack)</li> |
| 1449 | <li>general encoding cleanup + ISO-8859-x without iconv (Peter Jacobi)</li> |
| 1450 | <li>xmlTextReader cleanup + enum for node types (Bjorn Reese)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1451 | <li>general compilation/warning cleanup Solaris/HP-UX/... |
| 1452 | (WilliamBrack)</li> |
Daniel Veillard | 83ee40d | 2003-08-09 22:24:09 +0000 | [diff] [blame] | 1453 | </ul> |
| 1454 | |
Daniel Veillard | 560c2a4 | 2003-07-06 21:13:49 +0000 | [diff] [blame] | 1455 | <h3>2.5.8: Jul 6 2003</h3> |
| 1456 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1457 | <li>bugfixes: XPath, XInclude, file/URI mapping, UTF-16 save |
| 1458 | (MarkItzcovitz), UTF-8 checking, URI saving, error printing (William |
| 1459 | Brack),PI related memleak, compilation without schemas or without xpath |
| 1460 | (JoergSchmitz-Linneweber/Garry Pennington), xmlUnlinkNode problem with |
| 1461 | DTDs,rpm problem on , i86_64, removed a few compilation problems from |
| 1462 | 2.5.7,xmlIOParseDTD, and xmlSAXParseDTD (Malcolm Tredinnick)</li> |
Daniel Veillard | 560c2a4 | 2003-07-06 21:13:49 +0000 | [diff] [blame] | 1463 | <li>portability: DJGPP (MsDos) , OpenVMS (Craig A. Berry)</li> |
| 1464 | <li>William Brack fixed multithreading lock problems</li> |
| 1465 | <li>IPv6 patch for FTP and HTTP accesses (Archana Shah/Wipro)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1466 | <li>Windows fixes (Igor Zlatkovic, Eric Zurcher), threading |
| 1467 | (StéphaneBidoul)</li> |
Daniel Veillard | 560c2a4 | 2003-07-06 21:13:49 +0000 | [diff] [blame] | 1468 | <li>A few W3C Schemas Structure improvements</li> |
| 1469 | <li>W3C Schemas Datatype improvements (Charlie Bozeman)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1470 | <li>Python bindings for thread globals (Stéphane Bidoul), and |
| 1471 | method/classgenerator</li> |
Daniel Veillard | 83ee40d | 2003-08-09 22:24:09 +0000 | [diff] [blame] | 1472 | <li>added --nonet option to xmllint</li> |
Daniel Veillard | 560c2a4 | 2003-07-06 21:13:49 +0000 | [diff] [blame] | 1473 | <li>documentation improvements (John Fleck)</li> |
| 1474 | </ul> |
| 1475 | |
Daniel Veillard | 92fc02c | 2003-04-24 23:12:35 +0000 | [diff] [blame] | 1476 | <h3>2.5.7: Apr 25 2003</h3> |
| 1477 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1478 | <li>Relax-NG: Compiling to regexp and streaming validation on top of |
| 1479 | thexmlReader interface, added to xmllint --stream</li> |
Daniel Veillard | 92fc02c | 2003-04-24 23:12:35 +0000 | [diff] [blame] | 1480 | <li>xmlReader: Expand(), Next() and DOM access glue, bug fixes</li> |
| 1481 | <li>Support for large files: RGN validated a 4.5GB instance</li> |
| 1482 | <li>Thread support is now configured in by default</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1483 | <li>Fixes: update of the Trio code (Bjorn), WXS Date and Duration |
| 1484 | fixes(Charles Bozeman), DTD and namespaces (Brent Hendricks), HTML push |
| 1485 | parserand zero bytes handling, some missing Windows file path |
| 1486 | conversions,behaviour of the parser and validator in the presence of "out |
| 1487 | of memory"error conditions</li> |
| 1488 | <li>extended the API to be able to plug a garbage collecting |
| 1489 | memoryallocator, added xmlMallocAtomic() and modified the |
| 1490 | allocationsaccordingly.</li> |
| 1491 | <li>Performances: removed excessive malloc() calls, speedup of the push |
| 1492 | andxmlReader interfaces, removed excessive thread locking</li> |
Daniel Veillard | 92fc02c | 2003-04-24 23:12:35 +0000 | [diff] [blame] | 1493 | <li>Documentation: man page (John Fleck), xmlReader documentation</li> |
| 1494 | <li>Python: adding binding for xmlCatalogAddLocal (Brent M Hendricks)</li> |
| 1495 | </ul> |
| 1496 | |
Daniel Veillard | c2d4a93 | 2003-04-01 11:13:05 +0000 | [diff] [blame] | 1497 | <h3>2.5.6: Apr 1 2003</h3> |
| 1498 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1499 | <li>Fixed W3C XML Schemas datatype, should be compliant now except |
| 1500 | forbinHex and base64 which are not supported yet.</li> |
| 1501 | <li>bug fixes: non-ASCII IDs, HTML output, XInclude on large docs |
| 1502 | andXInclude entities handling, encoding detection on external subsets, |
| 1503 | XMLSchemas bugs and memory leaks, HTML parser (James Bursa)</li> |
Daniel Veillard | c2d4a93 | 2003-04-01 11:13:05 +0000 | [diff] [blame] | 1504 | <li>portability: python/trio (Albert Chin), Sun compiler warnings</li> |
| 1505 | <li>documentation: added --relaxng option to xmllint man page (John)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1506 | <li>improved error reporting: xml:space, start/end tag mismatches, Relax |
| 1507 | NGerrors</li> |
Daniel Veillard | c2d4a93 | 2003-04-01 11:13:05 +0000 | [diff] [blame] | 1508 | </ul> |
| 1509 | |
| 1510 | <h3>2.5.5: Mar 24 2003</h3> |
Daniel Veillard | d8da01c | 2003-03-24 15:58:23 +0000 | [diff] [blame] | 1511 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1512 | <li>Lot of fixes on the Relax NG implementation. More testing |
| 1513 | includingDocBook and TEI examples.</li> |
Daniel Veillard | d8da01c | 2003-03-24 15:58:23 +0000 | [diff] [blame] | 1514 | <li>Increased the support for W3C XML Schemas datatype</li> |
| 1515 | <li>Several bug fixes in the URI handling layer</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1516 | <li>Bug fixes: HTML parser, xmlReader, DTD validation, XPath, |
| 1517 | encodingconversion, line counting in the parser.</li> |
Daniel Veillard | d8da01c | 2003-03-24 15:58:23 +0000 | [diff] [blame] | 1518 | <li>Added support for $XMLLINT_INDENT environment variable, FTP delete</li> |
| 1519 | <li>Fixed the RPM spec file name</li> |
| 1520 | </ul> |
| 1521 | |
Daniel Veillard | 17bed98 | 2003-02-24 20:11:43 +0000 | [diff] [blame] | 1522 | <h3>2.5.4: Feb 20 2003</h3> |
| 1523 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1524 | <li>Conformance testing and lot of fixes on Relax NG and |
| 1525 | XIncludeimplementation</li> |
Daniel Veillard | 17bed98 | 2003-02-24 20:11:43 +0000 | [diff] [blame] | 1526 | <li>Implementation of XPointer element() scheme</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1527 | <li>Bug fixes: XML parser, XInclude entities merge, validity checking |
| 1528 | onnamespaces, |
| 1529 | <p>2 serialization bugs, node info generation problems, a DTD |
| 1530 | regexpgeneration problem.</p> |
Daniel Veillard | 17bed98 | 2003-02-24 20:11:43 +0000 | [diff] [blame] | 1531 | </li> |
| 1532 | <li>Portability: windows updates and path canonicalization (Igor)</li> |
| 1533 | <li>A few typo fixes (Kjartan Maraas)</li> |
| 1534 | <li>Python bindings generator fixes (Stephane Bidoul)</li> |
| 1535 | </ul> |
| 1536 | |
Daniel Veillard | 1d788d2 | 2003-02-10 16:21:58 +0000 | [diff] [blame] | 1537 | <h3>2.5.3: Feb 10 2003</h3> |
| 1538 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1539 | <li>RelaxNG and XML Schemas datatypes improvements, and added a |
| 1540 | firstversion of RelaxNG Python bindings</li> |
| 1541 | <li>Fixes: XLink (Sean Chittenden), XInclude (Sean Chittenden), API fix |
| 1542 | forserializing namespace nodes, encoding conversion bug, |
| 1543 | XHTML1serialization</li> |
Daniel Veillard | 1d788d2 | 2003-02-10 16:21:58 +0000 | [diff] [blame] | 1544 | <li>Portability fixes: Windows (Igor), AMD 64bits RPM spec file</li> |
| 1545 | </ul> |
| 1546 | |
Daniel Veillard | 72fef16 | 2003-02-05 14:31:19 +0000 | [diff] [blame] | 1547 | <h3>2.5.2: Feb 5 2003</h3> |
| 1548 | <ul> |
| 1549 | <li>First implementation of RelaxNG, added --relaxng flag to xmllint</li> |
| 1550 | <li>Schemas support now compiled in by default.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1551 | <li>Bug fixes: DTD validation, namespace checking, XInclude and |
| 1552 | entities,delegateURI in XML Catalogs, HTML parser, XML reader (Stéphane |
| 1553 | Bidoul),XPath parser and evaluation, UTF8ToUTF8 serialization, XML |
| 1554 | reader memoryconsumption, HTML parser, HTML serialization in the presence |
| 1555 | ofnamespaces</li> |
Daniel Veillard | 72fef16 | 2003-02-05 14:31:19 +0000 | [diff] [blame] | 1556 | <li>added an HTML API to check elements and attributes.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1557 | <li>Documentation improvement, PDF for the tutorial (John Fleck), |
| 1558 | docpatches (Stefan Kost)</li> |
Daniel Veillard | 72fef16 | 2003-02-05 14:31:19 +0000 | [diff] [blame] | 1559 | <li>Portability fixes: NetBSD (Julio Merino), Windows (Igor Zlatkovic)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1560 | <li>Added python bindings for XPointer, contextual error reporting(Stéphane |
| 1561 | Bidoul)</li> |
Daniel Veillard | 72fef16 | 2003-02-05 14:31:19 +0000 | [diff] [blame] | 1562 | <li>URI/file escaping problems (Stefano Zacchiroli)</li> |
Daniel Veillard | cf27f7c | 2002-04-30 07:12:39 +0000 | [diff] [blame] | 1563 | </ul> |
| 1564 | |
Daniel Veillard | e2830f1 | 2003-01-08 17:47:49 +0000 | [diff] [blame] | 1565 | <h3>2.5.1: Jan 8 2003</h3> |
| 1566 | <ul> |
| 1567 | <li>Fixes a memory leak and configuration/compilation problems in 2.5.0</li> |
| 1568 | <li>documentation updates (John)</li> |
| 1569 | <li>a couple of XmlTextReader fixes</li> |
| 1570 | </ul> |
| 1571 | |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 1572 | <h3>2.5.0: Jan 6 2003</h3> |
| 1573 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1574 | <li>New <a href="xmlreader.html">XmltextReader interface</a>based on C#API |
| 1575 | (with help of Stéphane Bidoul)</li> |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 1576 | <li>Windows: more exports, including the new API (Igor)</li> |
| 1577 | <li>XInclude fallback fix</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1578 | <li>Python: bindings for the new API, packaging (Stéphane |
| 1579 | Bidoul),drv_libxml2.py Python xml.sax driver (Stéphane Bidoul), fixes, |
| 1580 | speedupand iterators for Python-2.2 (Hannu Krosing)</li> |
| 1581 | <li>Tutorial fixes (john Fleck and Niraj Tolia) xmllint man |
| 1582 | update(John)</li> |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 1583 | <li>Fix an XML parser bug raised by Vyacheslav Pindyura</li> |
| 1584 | <li>Fix for VMS serialization (Nigel Hall) and config (Craig A. Berry)</li> |
| 1585 | <li>Entities handling fixes</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1586 | <li>new API to optionally track node creation and deletion |
| 1587 | (LukasSchroeder)</li> |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 1588 | <li>Added documentation for the XmltextReader interface and some <a |
| 1589 | href="guidelines.html">XML guidelines</a></li> |
| 1590 | </ul> |
| 1591 | |
Daniel Veillard | c1eed32 | 2002-12-12 11:01:32 +0000 | [diff] [blame] | 1592 | <h3>2.4.30: Dec 12 2002</h3> |
| 1593 | <ul> |
| 1594 | <li>2.4.29 broke the python bindings, rereleasing</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1595 | <li>Improvement/fixes of the XML API generator, and couple of minor |
| 1596 | codefixes.</li> |
Daniel Veillard | c1eed32 | 2002-12-12 11:01:32 +0000 | [diff] [blame] | 1597 | </ul> |
| 1598 | |
Daniel Veillard | 9b4bb4d | 2002-12-11 19:28:47 +0000 | [diff] [blame] | 1599 | <h3>2.4.29: Dec 11 2002</h3> |
| 1600 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1601 | <li>Windows fixes (Igor): Windows CE port, pthread linking, python |
| 1602 | bindings(Stéphane Bidoul), Mingw (Magnus Henoch), and export list |
| 1603 | updates</li> |
Daniel Veillard | 9b4bb4d | 2002-12-11 19:28:47 +0000 | [diff] [blame] | 1604 | <li>Fix for prev in python bindings (ERDI Gergo)</li> |
| 1605 | <li>Fix for entities handling (Marcus Clarke)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1606 | <li>Refactored the XML and HTML dumps to a single code path, fixed |
| 1607 | XHTML1dump</li> |
Daniel Veillard | 9b4bb4d | 2002-12-11 19:28:47 +0000 | [diff] [blame] | 1608 | <li>Fix for URI parsing when handling URNs with fragment identifiers</li> |
| 1609 | <li>Fix for HTTP URL escaping problem</li> |
| 1610 | <li>added an TextXmlReader (C#) like API (work in progress)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1611 | <li>Rewrote the API in XML generation script, includes a C parser and |
| 1612 | savesmore informations needed for C# bindings</li> |
Daniel Veillard | 9b4bb4d | 2002-12-11 19:28:47 +0000 | [diff] [blame] | 1613 | </ul> |
| 1614 | |
Daniel Veillard | f9c4cad | 2002-11-22 15:57:07 +0000 | [diff] [blame] | 1615 | <h3>2.4.28: Nov 22 2002</h3> |
| 1616 | <ul> |
| 1617 | <li>a couple of python binding fixes</li> |
| 1618 | <li>2 bug fixes in the XML push parser</li> |
| 1619 | <li>potential memory leak removed (Martin Stoilov)</li> |
| 1620 | <li>fix to the configure script for Unix (Dimitri Papadopoulos)</li> |
| 1621 | <li>added encoding support for XInclude parse="text"</li> |
| 1622 | <li>autodetection of XHTML1 and specific serialization rules added</li> |
Daniel Veillard | 9b4bb4d | 2002-12-11 19:28:47 +0000 | [diff] [blame] | 1623 | <li>nasty threading bug fixed (William Brack)</li> |
Daniel Veillard | f9c4cad | 2002-11-22 15:57:07 +0000 | [diff] [blame] | 1624 | </ul> |
| 1625 | |
Daniel Veillard | dad3f68 | 2002-11-17 16:47:27 +0000 | [diff] [blame] | 1626 | <h3>2.4.27: Nov 17 2002</h3> |
| 1627 | <ul> |
| 1628 | <li>fixes for the Python bindings</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1629 | <li>a number of bug fixes: SGML catalogs, |
| 1630 | xmlParseBalancedChunkMemory(),HTML parser, Schemas (Charles Bozeman), |
| 1631 | document fragment support(Christian Glahn), xmlReconciliateNs (Brian |
| 1632 | Stafford), XPointer,xmlFreeNode(), xmlSAXParseMemory (Peter Jones), |
| 1633 | xmlGetNodePath (PetrPajas), entities processing</li> |
Daniel Veillard | dad3f68 | 2002-11-17 16:47:27 +0000 | [diff] [blame] | 1634 | <li>added grep to xmllint --shell</li> |
| 1635 | <li>VMS update patch from Craig A. Berry</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1636 | <li>cleanup of the Windows build with support for more compilers |
| 1637 | (Igor),better thread support on Windows</li> |
Daniel Veillard | dad3f68 | 2002-11-17 16:47:27 +0000 | [diff] [blame] | 1638 | <li>cleanup of Unix Makefiles and spec file</li> |
| 1639 | <li>Improvements to the documentation (John Fleck)</li> |
| 1640 | </ul> |
| 1641 | |
Daniel Veillard | 4826743 | 2002-10-18 11:21:38 +0000 | [diff] [blame] | 1642 | <h3>2.4.26: Oct 18 2002</h3> |
| 1643 | <ul> |
| 1644 | <li>Patches for Windows CE port, improvements on Windows paths handling</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1645 | <li>Fixes to the validation code (DTD and Schemas), xmlNodeGetPath() ,HTML |
| 1646 | serialization, Namespace compliance, and a number of smallproblems</li> |
Daniel Veillard | 4826743 | 2002-10-18 11:21:38 +0000 | [diff] [blame] | 1647 | </ul> |
| 1648 | |
Daniel Veillard | e16b574 | 2002-09-26 17:50:03 +0000 | [diff] [blame] | 1649 | <h3>2.4.25: Sep 26 2002</h3> |
| 1650 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1651 | <li>A number of bug fixes: XPath, validation, Python bindings, DOM andtree, |
| 1652 | xmlI/O, Html</li> |
Daniel Veillard | e16b574 | 2002-09-26 17:50:03 +0000 | [diff] [blame] | 1653 | <li>Serious rewrite of XInclude</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1654 | <li>Made XML Schemas regexp part of the default build and APIs, small |
| 1655 | fixand improvement of the regexp core</li> |
Daniel Veillard | e16b574 | 2002-09-26 17:50:03 +0000 | [diff] [blame] | 1656 | <li>Changed the validation code to reuse XML Schemas regexp APIs</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1657 | <li>Better handling of Windows file paths, improvement of Makefiles |
| 1658 | (Igor,Daniel Gehriger, Mark Vakoc)</li> |
| 1659 | <li>Improved the python I/O bindings, the tests, added resolver and |
| 1660 | regexpAPIs</li> |
Daniel Veillard | e16b574 | 2002-09-26 17:50:03 +0000 | [diff] [blame] | 1661 | <li>New logos from Marc Liyanage</li> |
| 1662 | <li>Tutorial improvements: John Fleck, Christopher Harris</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1663 | <li>Makefile: Fixes for AMD x86_64 (Mandrake), DESTDIR |
| 1664 | (ChristopheMerlet)</li> |
Daniel Veillard | e16b574 | 2002-09-26 17:50:03 +0000 | [diff] [blame] | 1665 | <li>removal of all stderr/perror use for error reporting</li> |
| 1666 | <li>Better error reporting: XPath and DTD validation</li> |
| 1667 | <li>update of the trio portability layer (Bjorn Reese)</li> |
| 1668 | </ul> |
| 1669 | |
Daniel Veillard | 42766c0 | 2002-08-22 20:52:17 +0000 | [diff] [blame] | 1670 | <p><strong>2.4.24: Aug 22 2002</strong></p> |
| 1671 | <ul> |
| 1672 | <li>XPath fixes (William), xf:escape-uri() (Wesley Terpstra)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1673 | <li>Python binding fixes: makefiles (William), generator, rpm build, |
| 1674 | x86-64(fcrozat)</li> |
Daniel Veillard | 42766c0 | 2002-08-22 20:52:17 +0000 | [diff] [blame] | 1675 | <li>HTML <style> and boolean attributes serializer fixes</li> |
| 1676 | <li>C14N improvements by Aleksey</li> |
Daniel Veillard | e166254 | 2002-08-28 11:50:59 +0000 | [diff] [blame] | 1677 | <li>doc cleanups: Rick Jones</li> |
Daniel Veillard | 42766c0 | 2002-08-22 20:52:17 +0000 | [diff] [blame] | 1678 | <li>Windows compiler makefile updates: Igor and Elizabeth Barham</li> |
| 1679 | <li>XInclude: implementation of fallback and xml:base fixup added</li> |
| 1680 | </ul> |
| 1681 | |
Daniel Veillard | 782afda | 2002-07-08 15:12:49 +0000 | [diff] [blame] | 1682 | <h3>2.4.23: July 6 2002</h3> |
| 1683 | <ul> |
| 1684 | <li>performances patches: Peter Jacobi</li> |
| 1685 | <li>c14n fixes, testsuite and performances: Aleksey Sanin</li> |
| 1686 | <li>added xmlDocFormatDump: Chema Celorio</li> |
| 1687 | <li>new tutorial: John Fleck</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1688 | <li>new hash functions and performances: Sander Vesik, portability fix |
| 1689 | fromPeter Jacobi</li> |
| 1690 | <li>a number of bug fixes: XPath (William Brack, Richard Jinks), XML |
| 1691 | andHTML parsers, ID lookup function</li> |
Daniel Veillard | 782afda | 2002-07-08 15:12:49 +0000 | [diff] [blame] | 1692 | <li>removal of all remaining sprintf: Aleksey Sanin</li> |
| 1693 | </ul> |
| 1694 | |
Daniel Veillard | c0801af | 2002-05-28 16:28:42 +0000 | [diff] [blame] | 1695 | <h3>2.4.22: May 27 2002</h3> |
| 1696 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1697 | <li>a number of bug fixes: configure scripts, base handling, parser, |
| 1698 | memoryusage, HTML parser, XPath, documentation (Christian |
| 1699 | Cornelssen),indentation, URI parsing</li> |
| 1700 | <li>Optimizations for XMLSec, fixing and making public some of the |
| 1701 | networkprotocol handlers (Aleksey)</li> |
Daniel Veillard | c0801af | 2002-05-28 16:28:42 +0000 | [diff] [blame] | 1702 | <li>performance patch from Gary Pennington</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1703 | <li>Charles Bozeman provided date and time support for XML |
| 1704 | Schemasdatatypes</li> |
Daniel Veillard | c0801af | 2002-05-28 16:28:42 +0000 | [diff] [blame] | 1705 | </ul> |
| 1706 | |
Daniel Veillard | cf27f7c | 2002-04-30 07:12:39 +0000 | [diff] [blame] | 1707 | <h3>2.4.21: Apr 29 2002</h3> |
| 1708 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1709 | <p>This release is both a bug fix release and also contains the early |
| 1710 | XMLSchemas <a href="http://www.w3.org/TR/xmlschema-1/">structures</a>and <a |
| 1711 | href="http://www.w3.org/TR/xmlschema-2/">datatypes</a>code, beware, |
| 1712 | allinterfaces are likely to change, there is huge holes, it is clearly a work |
| 1713 | inprogress and don't even think of putting this code in a production |
| 1714 | system,it's actually not compiled in by default. The real fixes are:</p> |
Daniel Veillard | cf27f7c | 2002-04-30 07:12:39 +0000 | [diff] [blame] | 1715 | <ul> |
| 1716 | <li>a couple of bugs or limitations introduced in 2.4.20</li> |
| 1717 | <li>patches for Borland C++ and MSC by Igor</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1718 | <li>some fixes on XPath strings and conformance patches by RichardJinks</li> |
Daniel Veillard | cf27f7c | 2002-04-30 07:12:39 +0000 | [diff] [blame] | 1719 | <li>patch from Aleksey for the ExcC14N specification</li> |
| 1720 | <li>OSF/1 bug fix by Bjorn</li> |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 1721 | </ul> |
| 1722 | |
Daniel Veillard | a7084cd | 2002-04-15 17:12:47 +0000 | [diff] [blame] | 1723 | <h3>2.4.20: Apr 15 2002</h3> |
| 1724 | <ul> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1725 | <li>bug fixes: file descriptor leak, XPath, HTML output, DTD validation</li> |
Daniel Veillard | a7084cd | 2002-04-15 17:12:47 +0000 | [diff] [blame] | 1726 | <li>XPath conformance testing by Richard Jinks</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1727 | <li>Portability fixes: Solaris, MPE/iX, Windows, OSF/1, python |
| 1728 | bindings,libxml.m4</li> |
Daniel Veillard | a7084cd | 2002-04-15 17:12:47 +0000 | [diff] [blame] | 1729 | </ul> |
| 1730 | |
Daniel Veillard | 1927409 | 2002-03-25 16:48:03 +0000 | [diff] [blame] | 1731 | <h3>2.4.19: Mar 25 2002</h3> |
| 1732 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1733 | <li>bug fixes: half a dozen XPath bugs, Validation, ISO-Latin to |
| 1734 | UTF8encoder</li> |
Daniel Veillard | 1927409 | 2002-03-25 16:48:03 +0000 | [diff] [blame] | 1735 | <li>portability fixes in the HTTP code</li> |
Daniel Veillard | b2fb8ed | 2002-04-01 09:33:12 +0000 | [diff] [blame] | 1736 | <li>memory allocation checks using valgrind, and profiling tests</li> |
Daniel Veillard | 1927409 | 2002-03-25 16:48:03 +0000 | [diff] [blame] | 1737 | <li>revamp of the Windows build and Makefiles</li> |
| 1738 | </ul> |
| 1739 | |
Daniel Veillard | 34ce8be | 2002-03-18 19:37:11 +0000 | [diff] [blame] | 1740 | <h3>2.4.18: Mar 18 2002</h3> |
| 1741 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1742 | <li>bug fixes: tree, SAX, canonicalization, validation, |
| 1743 | portability,XPath</li> |
Daniel Veillard | 34ce8be | 2002-03-18 19:37:11 +0000 | [diff] [blame] | 1744 | <li>removed the --with-buffer option it was becoming unmaintainable</li> |
| 1745 | <li>serious cleanup of the Python makefiles</li> |
| 1746 | <li>speedup patch to XPath very effective for DocBook stylesheets</li> |
| 1747 | <li>Fixes for Windows build, cleanup of the documentation</li> |
| 1748 | </ul> |
| 1749 | |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 1750 | <h3>2.4.17: Mar 8 2002</h3> |
| 1751 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1752 | <li>a lot of bug fixes, including "namespace nodes have no parents |
| 1753 | inXPath"</li> |
| 1754 | <li>fixed/improved the Python wrappers, added more examples and |
| 1755 | moreregression tests, XPath extension functions can now return |
| 1756 | node-sets</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1757 | <li>added the XML Canonicalization support from Aleksey Sanin</li> |
Daniel Veillard | 3d6ae1c | 2001-08-15 13:12:39 +0000 | [diff] [blame] | 1758 | </ul> |
| 1759 | |
Daniel Veillard | 5f4b599 | 2002-02-20 10:22:49 +0000 | [diff] [blame] | 1760 | <h3>2.4.16: Feb 20 2002</h3> |
| 1761 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1762 | <li>a lot of bug fixes, most of them were triggered by the XML |
| 1763 | Testsuitefrom OASIS and W3C. Compliance has been significantly |
| 1764 | improved.</li> |
Daniel Veillard | 5f4b599 | 2002-02-20 10:22:49 +0000 | [diff] [blame] | 1765 | <li>a couple of portability fixes too.</li> |
| 1766 | </ul> |
| 1767 | |
Daniel Veillard | 397ff11 | 2002-02-11 18:27:20 +0000 | [diff] [blame] | 1768 | <h3>2.4.15: Feb 11 2002</h3> |
| 1769 | <ul> |
| 1770 | <li>Fixed the Makefiles, especially the python module ones</li> |
| 1771 | <li>A few bug fixes and cleanup</li> |
| 1772 | <li>Includes cleanup</li> |
| 1773 | </ul> |
| 1774 | |
Daniel Veillard | b6c1e2f | 2002-02-08 14:52:52 +0000 | [diff] [blame] | 1775 | <h3>2.4.14: Feb 8 2002</h3> |
| 1776 | <ul> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1777 | <li>Change of License to the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1778 | href="http://www.opensource.org/licenses/mit-license.html">MITLicense</a>basically |
| 1779 | for integration in XFree86 codebase, and removingconfusion around the |
| 1780 | previous dual-licensing</li> |
| 1781 | <li>added Python bindings, beta software but should already be |
| 1782 | quitecomplete</li> |
| 1783 | <li>a large number of fixes and cleanups, especially for all |
| 1784 | treemanipulations</li> |
| 1785 | <li>cleanup of the headers, generation of a reference API definition |
| 1786 | inXML</li> |
Daniel Veillard | b6c1e2f | 2002-02-08 14:52:52 +0000 | [diff] [blame] | 1787 | </ul> |
| 1788 | |
| 1789 | <h3>2.4.13: Jan 14 2002</h3> |
Daniel Veillard | 744683d | 2002-01-14 17:30:20 +0000 | [diff] [blame] | 1790 | <ul> |
| 1791 | <li>update of the documentation: John Fleck and Charlie Bozeman</li> |
| 1792 | <li>cleanup of timing code from Justin Fletcher</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1793 | <li>fixes for Windows and initial thread support on Win32: Igor and |
| 1794 | SergueiNarojnyi</li> |
Daniel Veillard | 744683d | 2002-01-14 17:30:20 +0000 | [diff] [blame] | 1795 | <li>Cygwin patch from Robert Collins</li> |
| 1796 | <li>added xmlSetEntityReferenceFunc() for Keith Isdale work on xsldbg</li> |
| 1797 | </ul> |
| 1798 | |
Daniel Veillard | ef90ba7 | 2001-12-07 14:24:22 +0000 | [diff] [blame] | 1799 | <h3>2.4.12: Dec 7 2001</h3> |
| 1800 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1801 | <li>a few bug fixes: thread (Gary Pennington), xmllint (Geert |
| 1802 | Kloosterman),XML parser (Robin Berjon), XPointer (Danny Jamshy), I/O |
| 1803 | cleanups(robert)</li> |
Daniel Veillard | ef90ba7 | 2001-12-07 14:24:22 +0000 | [diff] [blame] | 1804 | <li>Eric Lavigne contributed project files for MacOS</li> |
| 1805 | <li>some makefiles cleanups</li> |
| 1806 | </ul> |
| 1807 | |
Daniel Veillard | a487105 | 2001-11-26 13:19:48 +0000 | [diff] [blame] | 1808 | <h3>2.4.11: Nov 26 2001</h3> |
| 1809 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1810 | <li>fixed a couple of errors in the includes, fixed a few bugs, some |
| 1811 | codecleanups</li> |
Daniel Veillard | a487105 | 2001-11-26 13:19:48 +0000 | [diff] [blame] | 1812 | <li>xmllint man pages improvement by Heiko Rupp</li> |
| 1813 | <li>updated VMS build instructions from John A Fotheringham</li> |
| 1814 | <li>Windows Makefiles updates from Igor</li> |
| 1815 | </ul> |
| 1816 | |
Daniel Veillard | 43d3f61 | 2001-11-10 11:57:23 +0000 | [diff] [blame] | 1817 | <h3>2.4.10: Nov 10 2001</h3> |
| 1818 | <ul> |
| 1819 | <li>URI escaping fix (Joel Young)</li> |
| 1820 | <li>added xmlGetNodePath() (for paths or XPointers generation)</li> |
| 1821 | <li>Fixes namespace handling problems when using DTD and validation</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1822 | <li>improvements on xmllint: Morus Walter patches for --format and--encode, |
| 1823 | Stefan Kost and Heiko Rupp improvements on the --shell</li> |
Daniel Veillard | 43d3f61 | 2001-11-10 11:57:23 +0000 | [diff] [blame] | 1824 | <li>fixes for xmlcatalog linking pointed by Weiqi Gao</li> |
| 1825 | <li>fixes to the HTML parser</li> |
| 1826 | </ul> |
| 1827 | |
| 1828 | <h3>2.4.9: Nov 6 2001</h3> |
| 1829 | <ul> |
| 1830 | <li>fixes more catalog bugs</li> |
| 1831 | <li>avoid a compilation problem, improve xmlGetLineNo()</li> |
| 1832 | </ul> |
| 1833 | |
Daniel Veillard | ed421aa | 2001-11-04 21:22:45 +0000 | [diff] [blame] | 1834 | <h3>2.4.8: Nov 4 2001</h3> |
| 1835 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1836 | <li>fixed SGML catalogs broken in previous release, updated |
| 1837 | xmlcatalogtool</li> |
Daniel Veillard | ed421aa | 2001-11-04 21:22:45 +0000 | [diff] [blame] | 1838 | <li>fixed a compile errors and some includes troubles.</li> |
| 1839 | </ul> |
| 1840 | |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 1841 | <h3>2.4.7: Oct 30 2001</h3> |
| 1842 | <ul> |
| 1843 | <li>exported some debugging interfaces</li> |
| 1844 | <li>serious rewrite of the catalog code</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1845 | <li>integrated Gary Pennington thread safety patch, added configure |
| 1846 | optionand regression tests</li> |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 1847 | <li>removed an HTML parser bug</li> |
| 1848 | <li>fixed a couple of potentially serious validation bugs</li> |
| 1849 | <li>integrated the SGML DocBook support in xmllint</li> |
| 1850 | <li>changed the nanoftp anonymous login passwd</li> |
| 1851 | <li>some I/O cleanup and a couple of interfaces for Perl wrapper</li> |
| 1852 | <li>general bug fixes</li> |
| 1853 | <li>updated xmllint man page by John Fleck</li> |
| 1854 | <li>some VMS and Windows updates</li> |
| 1855 | </ul> |
| 1856 | |
Daniel Veillard | 60087f3 | 2001-10-10 09:45:09 +0000 | [diff] [blame] | 1857 | <h3>2.4.6: Oct 10 2001</h3> |
| 1858 | <ul> |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 1859 | <li>added an updated man pages by John Fleck</li> |
Daniel Veillard | 60087f3 | 2001-10-10 09:45:09 +0000 | [diff] [blame] | 1860 | <li>portability and configure fixes</li> |
| 1861 | <li>an infinite loop on the HTML parser was removed (William)</li> |
| 1862 | <li>Windows makefile patches from Igor</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1863 | <li>fixed half a dozen bugs reported for libxml or libxslt</li> |
Daniel Veillard | 60087f3 | 2001-10-10 09:45:09 +0000 | [diff] [blame] | 1864 | <li>updated xmlcatalog to be able to modify SGML super catalogs</li> |
| 1865 | </ul> |
| 1866 | |
Daniel Veillard | dadd087 | 2001-09-15 09:21:44 +0000 | [diff] [blame] | 1867 | <h3>2.4.5: Sep 14 2001</h3> |
| 1868 | <ul> |
| 1869 | <li>Remove a few annoying bugs in 2.4.4</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1870 | <li>forces the HTML serializer to output decimal charrefs since someversion |
| 1871 | of Netscape can't handle hexadecimal ones</li> |
Daniel Veillard | dadd087 | 2001-09-15 09:21:44 +0000 | [diff] [blame] | 1872 | </ul> |
| 1873 | |
| 1874 | <h3>1.8.16: Sep 14 2001</h3> |
| 1875 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1876 | <li>maintenance release of the old libxml1 branch, couple of bug |
| 1877 | andportability fixes</li> |
Daniel Veillard | dadd087 | 2001-09-15 09:21:44 +0000 | [diff] [blame] | 1878 | </ul> |
| 1879 | |
Daniel Veillard | 04382ae | 2001-09-12 18:51:30 +0000 | [diff] [blame] | 1880 | <h3>2.4.4: Sep 12 2001</h3> |
| 1881 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1882 | <li>added --convert to xmlcatalog, bug fixes and cleanups of XMLCatalog</li> |
Daniel Veillard | 04382ae | 2001-09-12 18:51:30 +0000 | [diff] [blame] | 1883 | <li>a few bug fixes and some portability changes</li> |
| 1884 | <li>some documentation cleanups</li> |
| 1885 | </ul> |
| 1886 | |
Daniel Veillard | 3993690 | 2001-08-24 00:49:01 +0000 | [diff] [blame] | 1887 | <h3>2.4.3: Aug 23 2001</h3> |
| 1888 | <ul> |
| 1889 | <li>XML Catalog support see the doc</li> |
| 1890 | <li>New NaN/Infinity floating point code</li> |
| 1891 | <li>A few bug fixes</li> |
| 1892 | </ul> |
| 1893 | |
| 1894 | <h3>2.4.2: Aug 15 2001</h3> |
Daniel Veillard | 3d6ae1c | 2001-08-15 13:12:39 +0000 | [diff] [blame] | 1895 | <ul> |
| 1896 | <li>adds xmlLineNumbersDefault() to control line number generation</li> |
| 1897 | <li>lot of bug fixes</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1898 | <li>the Microsoft MSC projects files should now be up to date</li> |
Daniel Veillard | 3d6ae1c | 2001-08-15 13:12:39 +0000 | [diff] [blame] | 1899 | <li>inheritance of namespaces from DTD defaulted attributes</li> |
| 1900 | <li>fixes a serious potential security bug</li> |
| 1901 | <li>added a --format option to xmllint</li> |
| 1902 | </ul> |
| 1903 | |
| 1904 | <h3>2.4.1: July 24 2001</h3> |
| 1905 | <ul> |
| 1906 | <li>possibility to keep line numbers in the tree</li> |
| 1907 | <li>some computation NaN fixes</li> |
| 1908 | <li>extension of the XPath API</li> |
| 1909 | <li>cleanup for alpha and ia64 targets</li> |
| 1910 | <li>patch to allow saving through HTTP PUT or POST</li> |
Daniel Veillard | 09ab7e1 | 2001-07-10 15:49:44 +0000 | [diff] [blame] | 1911 | </ul> |
| 1912 | |
| 1913 | <h3>2.4.0: July 10 2001</h3> |
| 1914 | <ul> |
| 1915 | <li>Fixed a few bugs in XPath, validation, and tree handling.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1916 | <li>Fixed XML Base implementation, added a couple of examples to |
| 1917 | theregression tests</li> |
Daniel Veillard | 09ab7e1 | 2001-07-10 15:49:44 +0000 | [diff] [blame] | 1918 | <li>A bit of cleanup</li> |
Daniel Veillard | ab8500d | 2000-10-15 21:06:19 +0000 | [diff] [blame] | 1919 | </ul> |
| 1920 | |
Daniel Veillard | 5b43fde | 2001-07-05 23:31:40 +0000 | [diff] [blame] | 1921 | <h3>2.3.14: July 5 2001</h3> |
| 1922 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1923 | <li>fixed some entities problems and reduce memory requirement |
| 1924 | whensubstituting them</li> |
| 1925 | <li>lots of improvements in the XPath queries interpreter can |
| 1926 | besubstantially faster</li> |
Daniel Veillard | 5b43fde | 2001-07-05 23:31:40 +0000 | [diff] [blame] | 1927 | <li>Makefiles and configure cleanups</li> |
| 1928 | <li>Fixes to XPath variable eval, and compare on empty node set</li> |
| 1929 | <li>HTML tag closing bug fixed</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1930 | <li>Fixed an URI reference computation problem when validating</li> |
Daniel Veillard | 5b43fde | 2001-07-05 23:31:40 +0000 | [diff] [blame] | 1931 | </ul> |
| 1932 | |
Daniel Veillard | 2adbb51 | 2001-06-28 16:20:36 +0000 | [diff] [blame] | 1933 | <h3>2.3.13: June 28 2001</h3> |
| 1934 | <ul> |
| 1935 | <li>2.3.12 configure.in was broken as well as the push mode XML parser</li> |
| 1936 | <li>a few more fixes for compilation on Windows MSC by Yon Derek</li> |
| 1937 | </ul> |
| 1938 | |
| 1939 | <h3>1.8.14: June 28 2001</h3> |
| 1940 | <ul> |
| 1941 | <li>Zbigniew Chyla gave a patch to use the old XML parser in push mode</li> |
| 1942 | <li>Small Makefile fix</li> |
| 1943 | </ul> |
| 1944 | |
Daniel Veillard | 1164810 | 2001-06-26 16:08:24 +0000 | [diff] [blame] | 1945 | <h3>2.3.12: June 26 2001</h3> |
| 1946 | <ul> |
| 1947 | <li>lots of cleanup</li> |
| 1948 | <li>a couple of validation fix</li> |
| 1949 | <li>fixed line number counting</li> |
| 1950 | <li>fixed serious problems in the XInclude processing</li> |
| 1951 | <li>added support for UTF8 BOM at beginning of entities</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1952 | <li>fixed a strange gcc optimizer bugs in xpath handling of float, |
| 1953 | gcc-3.0miscompile uri.c (William), Thomas Leitner provided a fix for |
| 1954 | theoptimizer on Tru64</li> |
| 1955 | <li>incorporated Yon Derek and Igor Zlatkovic fixes and improvements |
| 1956 | forcompilation on Windows MSC</li> |
Daniel Veillard | 1164810 | 2001-06-26 16:08:24 +0000 | [diff] [blame] | 1957 | <li>update of libxml-doc.el (Felix Natter)</li> |
| 1958 | <li>fixed 2 bugs in URI normalization code</li> |
| 1959 | </ul> |
| 1960 | |
Daniel Veillard | e3c81b5 | 2001-06-17 14:50:34 +0000 | [diff] [blame] | 1961 | <h3>2.3.11: June 17 2001</h3> |
| 1962 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1963 | <li>updates to trio, Makefiles and configure should fix some |
| 1964 | portabilityproblems (alpha)</li> |
| 1965 | <li>fixed some HTML serialization problems (pre, script, and |
| 1966 | block/inlinehandling), added encoding aware APIs, cleanup of this |
| 1967 | code</li> |
Daniel Veillard | e3c81b5 | 2001-06-17 14:50:34 +0000 | [diff] [blame] | 1968 | <li>added xmlHasNsProp()</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1969 | <li>implemented a specific PI for encoding support in the DocBook |
| 1970 | SGMLparser</li> |
| 1971 | <li>some XPath fixes (-Infinity, / as a function parameter and |
| 1972 | namespacesnode selection)</li> |
Daniel Veillard | e3c81b5 | 2001-06-17 14:50:34 +0000 | [diff] [blame] | 1973 | <li>fixed a performance problem and an error in the validation code</li> |
| 1974 | <li>fixed XInclude routine to implement the recursive behaviour</li> |
| 1975 | <li>fixed xmlFreeNode problem when libxml is included statically twice</li> |
| 1976 | <li>added --version to xmllint for bug reports</li> |
| 1977 | </ul> |
| 1978 | |
Daniel Veillard | 2e4f188 | 2001-06-01 10:11:57 +0000 | [diff] [blame] | 1979 | <h3>2.3.10: June 1 2001</h3> |
| 1980 | <ul> |
| 1981 | <li>fixed the SGML catalog support</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1982 | <li>a number of reported bugs got fixed, in XPath, iconv detection,XInclude |
| 1983 | processing</li> |
Daniel Veillard | 2e4f188 | 2001-06-01 10:11:57 +0000 | [diff] [blame] | 1984 | <li>XPath string function should now handle unicode correctly</li> |
| 1985 | </ul> |
| 1986 | |
Daniel Veillard | 4623acd | 2001-05-19 15:13:15 +0000 | [diff] [blame] | 1987 | <h3>2.3.9: May 19 2001</h3> |
| 1988 | |
| 1989 | <p>Lots of bugfixes, and added a basic SGML catalog support:</p> |
| 1990 | <ul> |
| 1991 | <li>HTML push bugfix #54891 and another patch from Jonas Borgström</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1992 | <li>some serious speed optimization again</li> |
Daniel Veillard | 4623acd | 2001-05-19 15:13:15 +0000 | [diff] [blame] | 1993 | <li>some documentation cleanups</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 1994 | <li>trying to get better linking on Solaris (-R)</li> |
Daniel Veillard | 4623acd | 2001-05-19 15:13:15 +0000 | [diff] [blame] | 1995 | <li>XPath API cleanup from Thomas Broyer</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 1996 | <li>Validation bug fixed #54631, added a patch from Gary Pennington, |
| 1997 | fixedxmlValidGetValidElements()</li> |
Daniel Veillard | 4623acd | 2001-05-19 15:13:15 +0000 | [diff] [blame] | 1998 | <li>Added an INSTALL file</li> |
| 1999 | <li>Attribute removal added to API: #54433</li> |
| 2000 | <li>added a basic support for SGML catalogs</li> |
| 2001 | <li>fixed xmlKeepBlanksDefault(0) API</li> |
| 2002 | <li>bugfix in xmlNodeGetLang()</li> |
| 2003 | <li>fixed a small configure portability problem</li> |
| 2004 | <li>fixed an inversion of SYSTEM and PUBLIC identifier in HTML document</li> |
| 2005 | </ul> |
| 2006 | |
Daniel Veillard | a265af7 | 2001-05-14 11:13:58 +0000 | [diff] [blame] | 2007 | <h3>1.8.13: May 14 2001</h3> |
| 2008 | <ul> |
| 2009 | <li>bugfixes release of the old libxml1 branch used by Gnome</li> |
| 2010 | </ul> |
| 2011 | |
Daniel Veillard | 3bbbe6f | 2001-05-03 11:15:37 +0000 | [diff] [blame] | 2012 | <h3>2.3.8: May 3 2001</h3> |
| 2013 | <ul> |
| 2014 | <li>Integrated an SGML DocBook parser for the Gnome project</li> |
| 2015 | <li>Fixed a few things in the HTML parser</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2016 | <li>Fixed some XPath bugs raised by XSLT use, tried to fix the |
| 2017 | floatingpoint portability issue</li> |
| 2018 | <li>Speed improvement (8M/s for SAX, 3M/s for DOM, 1.5M/s forDOM+validation |
| 2019 | using the XML REC as input and a 700MHz celeron).</li> |
Daniel Veillard | 3bbbe6f | 2001-05-03 11:15:37 +0000 | [diff] [blame] | 2020 | <li>incorporated more Windows cleanup</li> |
| 2021 | <li>added xmlSaveFormatFile()</li> |
| 2022 | <li>fixed problems in copying nodes with entities references (gdome)</li> |
| 2023 | <li>removed some troubles surrounding the new validation module</li> |
| 2024 | </ul> |
| 2025 | |
Daniel Veillard | a41123c | 2001-04-22 19:31:20 +0000 | [diff] [blame] | 2026 | <h3>2.3.7: April 22 2001</h3> |
| 2027 | <ul> |
| 2028 | <li>lots of small bug fixes, corrected XPointer</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2029 | <li>Non deterministic content model validation support</li> |
Daniel Veillard | a41123c | 2001-04-22 19:31:20 +0000 | [diff] [blame] | 2030 | <li>added xmlDocCopyNode for gdome2</li> |
| 2031 | <li>revamped the way the HTML parser handles end of tags</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2032 | <li>XPath: corrections of namespaces support and number formatting</li> |
Daniel Veillard | a41123c | 2001-04-22 19:31:20 +0000 | [diff] [blame] | 2033 | <li>Windows: Igor Zlatkovic patches for MSC compilation</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2034 | <li>HTML output fixes from P C Chow and William M. Brack</li> |
Daniel Veillard | a41123c | 2001-04-22 19:31:20 +0000 | [diff] [blame] | 2035 | <li>Improved validation speed sensible for DocBook</li> |
| 2036 | <li>fixed a big bug with ID declared in external parsed entities</li> |
| 2037 | <li>portability fixes, update of Trio from Bjorn Reese</li> |
| 2038 | </ul> |
| 2039 | |
Daniel Veillard | afc7311 | 2001-04-11 11:51:41 +0000 | [diff] [blame] | 2040 | <h3>2.3.6: April 8 2001</h3> |
| 2041 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2042 | <li>Code cleanup using extreme gcc compiler warning options, found |
| 2043 | andcleared half a dozen potential problem</li> |
Daniel Veillard | afc7311 | 2001-04-11 11:51:41 +0000 | [diff] [blame] | 2044 | <li>the Eazel team found an XML parser bug</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2045 | <li>cleaned up the user of some of the string formatting function. used |
| 2046 | thetrio library code to provide the one needed when the platform is |
| 2047 | missingthem</li> |
| 2048 | <li>xpath: removed a memory leak and fixed the predicate evaluationproblem, |
| 2049 | extended the testsuite and cleaned up the result. XPointer seemsbroken |
| 2050 | ...</li> |
Daniel Veillard | afc7311 | 2001-04-11 11:51:41 +0000 | [diff] [blame] | 2051 | </ul> |
| 2052 | |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 2053 | <h3>2.3.5: Mar 23 2001</h3> |
| 2054 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2055 | <li>Biggest change is separate parsing and evaluation of XPath |
| 2056 | expressions,there is some new APIs for this too</li> |
| 2057 | <li>included a number of bug fixes(XML push parser, 51876, |
| 2058 | notations,52299)</li> |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 2059 | <li>Fixed some portability issues</li> |
| 2060 | </ul> |
| 2061 | |
Daniel Veillard | e356c28 | 2001-03-10 12:32:04 +0000 | [diff] [blame] | 2062 | <h3>2.3.4: Mar 10 2001</h3> |
| 2063 | <ul> |
| 2064 | <li>Fixed bugs #51860 and #51861</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2065 | <li>Added a global variable xmlDefaultBufferSize to allow default |
| 2066 | buffersize to be application tunable.</li> |
| 2067 | <li>Some cleanup in the validation code, still a bug left and this |
| 2068 | partshould probably be rewritten to support ambiguous content model |
| 2069 | :-\</li> |
| 2070 | <li>Fix a couple of serious bugs introduced or raised by changes in |
| 2071 | 2.3.3parser</li> |
Daniel Veillard | e356c28 | 2001-03-10 12:32:04 +0000 | [diff] [blame] | 2072 | <li>Fixed another bug in xmlNodeGetContent()</li> |
| 2073 | <li>Bjorn fixed XPath node collection and Number formatting</li> |
| 2074 | <li>Fixed a loop reported in the HTML parsing</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2075 | <li>blank space are reported even if the Dtd content model proves that |
| 2076 | theyare formatting spaces, this is for XML conformance</li> |
Daniel Veillard | e356c28 | 2001-03-10 12:32:04 +0000 | [diff] [blame] | 2077 | </ul> |
| 2078 | |
Daniel Veillard | b402c07 | 2001-03-01 17:28:58 +0000 | [diff] [blame] | 2079 | <h3>2.3.3: Mar 1 2001</h3> |
| 2080 | <ul> |
| 2081 | <li>small change in XPath for XSLT</li> |
| 2082 | <li>documentation cleanups</li> |
| 2083 | <li>fix in validation by Gary Pennington</li> |
| 2084 | <li>serious parsing performances improvements</li> |
| 2085 | </ul> |
| 2086 | |
Daniel Veillard | ec70e91 | 2001-02-26 20:10:45 +0000 | [diff] [blame] | 2087 | <h3>2.3.2: Feb 24 2001</h3> |
Daniel Veillard | 7168110 | 2001-02-24 17:48:53 +0000 | [diff] [blame] | 2088 | <ul> |
| 2089 | <li>chasing XPath bugs, found a bunch, completed some TODO</li> |
| 2090 | <li>fixed a Dtd parsing bug</li> |
| 2091 | <li>fixed a bug in xmlNodeGetContent</li> |
| 2092 | <li>ID/IDREF support partly rewritten by Gary Pennington</li> |
| 2093 | </ul> |
| 2094 | |
Daniel Veillard | ec70e91 | 2001-02-26 20:10:45 +0000 | [diff] [blame] | 2095 | <h3>2.3.1: Feb 15 2001</h3> |
Daniel Veillard | 6e6a6cc | 2001-02-15 15:55:44 +0000 | [diff] [blame] | 2096 | <ul> |
| 2097 | <li>some XPath and HTML bug fixes for XSLT</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2098 | <li>small extension of the hash table interfaces for DOM |
| 2099 | gdome2implementation</li> |
Daniel Veillard | 6e6a6cc | 2001-02-15 15:55:44 +0000 | [diff] [blame] | 2100 | <li>A few bug fixes</li> |
| 2101 | </ul> |
| 2102 | |
Daniel Veillard | ec70e91 | 2001-02-26 20:10:45 +0000 | [diff] [blame] | 2103 | <h3>2.3.0: Feb 8 2001 (2.2.12 was on 25 Jan but I didn't kept track)</h3> |
Daniel Veillard | 6e6a6cc | 2001-02-15 15:55:44 +0000 | [diff] [blame] | 2104 | <ul> |
| 2105 | <li>Lots of XPath bug fixes</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2106 | <li>Add a mode with Dtd lookup but without validation error reporting |
| 2107 | forXSLT</li> |
Daniel Veillard | 6e6a6cc | 2001-02-15 15:55:44 +0000 | [diff] [blame] | 2108 | <li>Add support for text node without escaping (XSLT)</li> |
| 2109 | <li>bug fixes for xmlCheckFilename</li> |
| 2110 | <li>validation code bug fixes from Gary Pennington</li> |
| 2111 | <li>Patch from Paul D. Smith correcting URI path normalization</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2112 | <li>Patch to allow simultaneous install of libxml-devel |
| 2113 | andlibxml2-devel</li> |
Daniel Veillard | 6e6a6cc | 2001-02-15 15:55:44 +0000 | [diff] [blame] | 2114 | <li>the example Makefile is now fixed</li> |
| 2115 | <li>added HTML to the RPM packages</li> |
| 2116 | <li>tree copying bugfixes</li> |
| 2117 | <li>updates to Windows makefiles</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2118 | <li>optimization patch from Bjorn Reese</li> |
Daniel Veillard | 6e6a6cc | 2001-02-15 15:55:44 +0000 | [diff] [blame] | 2119 | </ul> |
| 2120 | |
Daniel Veillard | ec70e91 | 2001-02-26 20:10:45 +0000 | [diff] [blame] | 2121 | <h3>2.2.11: Jan 4 2001</h3> |
Daniel Veillard | 503b893 | 2001-01-05 06:36:31 +0000 | [diff] [blame] | 2122 | <ul> |
| 2123 | <li>bunch of bug fixes (memory I/O, xpath, ftp/http, ...)</li> |
| 2124 | <li>added htmlHandleOmittedElem()</li> |
| 2125 | <li>Applied Bjorn Reese's IPV6 first patch</li> |
| 2126 | <li>Applied Paul D. Smith patches for validation of XInclude results</li> |
Daniel Veillard | 8268716 | 2001-01-22 15:32:01 +0000 | [diff] [blame] | 2127 | <li>added XPointer xmlns() new scheme support</li> |
Daniel Veillard | 503b893 | 2001-01-05 06:36:31 +0000 | [diff] [blame] | 2128 | </ul> |
| 2129 | |
Daniel Veillard | 2ddd23d | 2000-11-25 10:42:19 +0000 | [diff] [blame] | 2130 | <h3>2.2.10: Nov 25 2000</h3> |
Daniel Veillard | 9d343c4 | 2000-11-25 10:12:43 +0000 | [diff] [blame] | 2131 | <ul> |
| 2132 | <li>Fix the Windows problems of 2.2.8</li> |
| 2133 | <li>integrate OpenVMS patches</li> |
| 2134 | <li>better handling of some nasty HTML input</li> |
| 2135 | <li>Improved the XPointer implementation</li> |
| 2136 | <li>integrate a number of provided patches</li> |
| 2137 | </ul> |
| 2138 | |
Daniel Veillard | 2ddd23d | 2000-11-25 10:42:19 +0000 | [diff] [blame] | 2139 | <h3>2.2.9: Nov 25 2000</h3> |
| 2140 | <ul> |
| 2141 | <li>erroneous release :-(</li> |
| 2142 | </ul> |
| 2143 | |
Daniel Veillard | 28929b2 | 2000-11-13 18:22:49 +0000 | [diff] [blame] | 2144 | <h3>2.2.8: Nov 13 2000</h3> |
| 2145 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2146 | <li>First version of <a |
| 2147 | href="http://www.w3.org/TR/xinclude">XInclude</a>support</li> |
Daniel Veillard | 28929b2 | 2000-11-13 18:22:49 +0000 | [diff] [blame] | 2148 | <li>Patch in conditional section handling</li> |
| 2149 | <li>updated MS compiler project</li> |
| 2150 | <li>fixed some XPath problems</li> |
| 2151 | <li>added an URI escaping function</li> |
| 2152 | <li>some other bug fixes</li> |
| 2153 | </ul> |
| 2154 | |
| 2155 | <h3>2.2.7: Oct 31 2000</h3> |
| 2156 | <ul> |
| 2157 | <li>added message redirection</li> |
| 2158 | <li>XPath improvements (thanks TOM !)</li> |
| 2159 | <li>xmlIOParseDTD() added</li> |
| 2160 | <li>various small fixes in the HTML, URI, HTTP and XPointer support</li> |
| 2161 | <li>some cleanup of the Makefile, autoconf and the distribution content</li> |
| 2162 | </ul> |
| 2163 | |
Daniel Veillard | 29a11cc | 2000-10-25 13:32:39 +0000 | [diff] [blame] | 2164 | <h3>2.2.6: Oct 25 2000:</h3> |
| 2165 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2166 | <li>Added an hash table module, migrated a number of internal structure |
| 2167 | tothose</li> |
Daniel Veillard | 29a11cc | 2000-10-25 13:32:39 +0000 | [diff] [blame] | 2168 | <li>Fixed a posteriori validation problems</li> |
| 2169 | <li>HTTP module cleanups</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2170 | <li>HTML parser improvements (tag errors, script/style handling, |
| 2171 | attributenormalization)</li> |
Daniel Veillard | 29a11cc | 2000-10-25 13:32:39 +0000 | [diff] [blame] | 2172 | <li>coalescing of adjacent text nodes</li> |
| 2173 | <li>couple of XPath bug fixes, exported the internal API</li> |
| 2174 | </ul> |
| 2175 | |
Daniel Veillard | ab8500d | 2000-10-15 21:06:19 +0000 | [diff] [blame] | 2176 | <h3>2.2.5: Oct 15 2000:</h3> |
Daniel Veillard | 4c3a203 | 1999-11-19 17:46:26 +0000 | [diff] [blame] | 2177 | <ul> |
Daniel Veillard | 189446d | 2000-10-13 10:23:06 +0000 | [diff] [blame] | 2178 | <li>XPointer implementation and testsuite</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2179 | <li>Lot of XPath fixes, added variable and functions registration, |
| 2180 | moretests</li> |
| 2181 | <li>Portability fixes, lots of enhancements toward an easy Windows buildand |
| 2182 | release</li> |
Daniel Veillard | 189446d | 2000-10-13 10:23:06 +0000 | [diff] [blame] | 2183 | <li>Late validation fixes</li> |
| 2184 | <li>Integrated a lot of contributed patches</li> |
| 2185 | <li>added memory management docs</li> |
Daniel Veillard | ab8500d | 2000-10-15 21:06:19 +0000 | [diff] [blame] | 2186 | <li>a performance problem when using large buffer seems fixed</li> |
Daniel Veillard | 189446d | 2000-10-13 10:23:06 +0000 | [diff] [blame] | 2187 | </ul> |
| 2188 | |
| 2189 | <h3>2.2.4: Oct 1 2000:</h3> |
| 2190 | <ul> |
| 2191 | <li>main XPath problem fixed</li> |
| 2192 | <li>Integrated portability patches for Windows</li> |
| 2193 | <li>Serious bug fixes on the URI and HTML code</li> |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 2194 | </ul> |
| 2195 | |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 2196 | <h3>2.2.3: Sep 17 2000</h3> |
| 2197 | <ul> |
| 2198 | <li>bug fixes</li> |
| 2199 | <li>cleanup of entity handling code</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2200 | <li>overall review of all loops in the parsers, all sprintf usage has |
| 2201 | beenchecked too</li> |
| 2202 | <li>Far better handling of larges Dtd. Validating against DocBook XML |
| 2203 | Dtdworks smoothly now.</li> |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 2204 | </ul> |
| 2205 | |
| 2206 | <h3>1.8.10: Sep 6 2000</h3> |
| 2207 | <ul> |
| 2208 | <li>bug fix release for some Gnome projects</li> |
| 2209 | </ul> |
| 2210 | |
| 2211 | <h3>2.2.2: August 12 2000</h3> |
Daniel Veillard | 786d7c8 | 2000-08-12 23:38:57 +0000 | [diff] [blame] | 2212 | <ul> |
| 2213 | <li>mostly bug fixes</li> |
Daniel Veillard | ec78c0f | 2000-08-25 10:25:23 +0000 | [diff] [blame] | 2214 | <li>started adding routines to access xml parser context options</li> |
Daniel Veillard | 786d7c8 | 2000-08-12 23:38:57 +0000 | [diff] [blame] | 2215 | </ul> |
| 2216 | |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 2217 | <h3>2.2.1: July 21 2000</h3> |
Daniel Veillard | a2679fa | 2000-07-22 02:38:15 +0000 | [diff] [blame] | 2218 | <ul> |
| 2219 | <li>a purely bug fixes release</li> |
| 2220 | <li>fixed an encoding support problem when parsing from a memory block</li> |
| 2221 | <li>fixed a DOCTYPE parsing problem</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2222 | <li>removed a bug in the function allowing to override the memoryallocation |
| 2223 | routines</li> |
Daniel Veillard | a2679fa | 2000-07-22 02:38:15 +0000 | [diff] [blame] | 2224 | </ul> |
| 2225 | |
Daniel Veillard | d5f97f8 | 2000-09-17 16:38:14 +0000 | [diff] [blame] | 2226 | <h3>2.2.0: July 14 2000</h3> |
Daniel Veillard | 94e9060 | 2000-07-17 14:38:19 +0000 | [diff] [blame] | 2227 | <ul> |
| 2228 | <li>applied a lot of portability fixes</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2229 | <li>better encoding support/cleanup and saving (content is now |
| 2230 | alwaysencoded in UTF-8)</li> |
Daniel Veillard | 94e9060 | 2000-07-17 14:38:19 +0000 | [diff] [blame] | 2231 | <li>the HTML parser now correctly handles encodings</li> |
| 2232 | <li>added xmlHasProp()</li> |
| 2233 | <li>fixed a serious problem with &#38;</li> |
| 2234 | <li>propagated the fix to FTP client</li> |
| 2235 | <li>cleanup, bugfixes, etc ...</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2236 | <li>Added a page about <a href="encoding.html">libxml |
| 2237 | Internationalizationsupport</a></li> |
Daniel Veillard | 94e9060 | 2000-07-17 14:38:19 +0000 | [diff] [blame] | 2238 | </ul> |
| 2239 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 2240 | <h3>1.8.9: July 9 2000</h3> |
| 2241 | <ul> |
| 2242 | <li>fixed the spec the RPMs should be better</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2243 | <li>fixed a serious bug in the FTP implementation, released 1.8.9 to |
| 2244 | solverpmfind users problem</li> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 2245 | </ul> |
| 2246 | |
Daniel Veillard | 6388e17 | 2000-07-03 16:07:19 +0000 | [diff] [blame] | 2247 | <h3>2.1.1: July 1 2000</h3> |
| 2248 | <ul> |
| 2249 | <li>fixes a couple of bugs in the 2.1.0 packaging</li> |
| 2250 | <li>improvements on the HTML parser</li> |
| 2251 | </ul> |
| 2252 | |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 2253 | <h3>2.1.0 and 1.8.8: June 29 2000</h3> |
| 2254 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2255 | <li>1.8.8 is mostly a commodity package for upgrading to libxml2 |
| 2256 | accordingto <a href="upgrade.html">new instructions</a>. It fixes a nasty |
| 2257 | problemabout &#38; charref parsing</li> |
| 2258 | <li>2.1.0 also ease the upgrade from libxml v1 to the recent version. |
| 2259 | italso contains numerous fixes and enhancements: |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 2260 | <ul> |
| 2261 | <li>added xmlStopParser() to stop parsing</li> |
| 2262 | <li>improved a lot parsing speed when there is large CDATA blocs</li> |
| 2263 | <li>includes XPath patches provided by Picdar Technology</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2264 | <li>tried to fix as much as possible DTD validation and |
| 2265 | namespacerelated problems</li> |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 2266 | <li>output to a given encoding has been added/tested</li> |
| 2267 | <li>lot of various fixes</li> |
| 2268 | </ul> |
| 2269 | </li> |
| 2270 | </ul> |
| 2271 | |
Daniel Veillard | e0aed30 | 2000-04-16 08:52:20 +0000 | [diff] [blame] | 2272 | <h3>2.0.0: Apr 12 2000</h3> |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 2273 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2274 | <li>First public release of libxml2. If you are using libxml, it's a |
| 2275 | goodidea to check the 1.x to 2.x upgrade instructions. NOTE: while |
| 2276 | initiallyscheduled for Apr 3 the release occurred only on Apr 12 due to |
| 2277 | massiveworkload.</li> |
| 2278 | <li>The include are now located under $prefix/include/libxml (instead |
| 2279 | of$prefix/include/gnome-xml), they also are referenced by |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 2280 | <pre>#include <libxml/xxx.h></pre> |
Daniel Veillard | e0aed30 | 2000-04-16 08:52:20 +0000 | [diff] [blame] | 2281 | <p>instead of</p> |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 2282 | <pre>#include "xxx.h"</pre> |
| 2283 | </li> |
Daniel Veillard | 8f62198 | 2000-03-20 13:07:15 +0000 | [diff] [blame] | 2284 | <li>a new URI module for parsing URIs and following strictly RFC 2396</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2285 | <li>the memory allocation routines used by libxml can now be |
| 2286 | overloadeddynamically by using xmlMemSetup()</li> |
| 2287 | <li>The previously CVS only tool tester has been |
| 2288 | renamed<strong>xmllint</strong>and is now installed as part of the |
| 2289 | libxml2package</li> |
| 2290 | <li>The I/O interface has been revamped. There is now ways to plug |
| 2291 | inspecific I/O modules, either at the URI scheme detection level |
| 2292 | usingxmlRegisterInputCallbacks() or by passing I/O functions when |
| 2293 | creating aparser context using xmlCreateIOParserCtxt()</li> |
| 2294 | <li>there is a C preprocessor macro LIBXML_VERSION providing the |
| 2295 | versionnumber of the libxml module in use</li> |
| 2296 | <li>a number of optional features of libxml can now be excluded atconfigure |
| 2297 | time (FTP/HTTP/HTML/XPath/Debug)</li> |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 2298 | </ul> |
| 2299 | |
| 2300 | <h3>2.0.0beta: Mar 14 2000</h3> |
| 2301 | <ul> |
| 2302 | <li>This is a first Beta release of libxml version 2</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2303 | <li>It's available only from<a |
| 2304 | href="ftp://xmlsoft.org/libxml2/">xmlsoft.orgFTP</a>, it's packaged as |
| 2305 | libxml2-2.0.0beta and available as tar andRPMs</li> |
| 2306 | <li>This version is now the head in the Gnome CVS base, the old one |
| 2307 | isavailable under the tag LIB_XML_1_X</li> |
| 2308 | <li>This includes a very large set of changes. From a programmatic pointof |
| 2309 | view applications should not have to be modified too much, check the<a |
| 2310 | href="upgrade.html">upgrade page</a></li> |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 2311 | <li>Some interfaces may changes (especially a bit about encoding).</li> |
| 2312 | <li>the updates includes: |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 2313 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2314 | <li>fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems |
| 2315 | correctlyhandled now</li> |
| 2316 | <li>Better handling of entities, especially well-formedness checkingand |
| 2317 | proper PEref extensions in external subsets</li> |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 2318 | <li>DTD conditional sections</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2319 | <li>Validation now correctly handle entities content</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2320 | <li><a |
| 2321 | href="http://rpmfind.net/tools/gdome/messages/0039.html">changestructures |
| 2322 | to accommodate DOM</a></li> |
Daniel Veillard | 6c8b117 | 2000-03-01 00:40:41 +0000 | [diff] [blame] | 2323 | </ul> |
| 2324 | </li> |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 2325 | <li>Serious progress were made toward compliance, <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2326 | href="conf/result.html">here are the result of the test</a>against |
| 2327 | theOASIS testsuite (except the Japanese tests since I don't support |
| 2328 | thatencoding yet). This URL is rebuilt every couple of hours using the |
| 2329 | CVShead version.</li> |
Daniel Veillard | e41f2b7 | 2000-01-30 20:00:07 +0000 | [diff] [blame] | 2330 | </ul> |
| 2331 | |
Daniel Veillard | f13e1ed | 2000-03-06 07:41:49 +0000 | [diff] [blame] | 2332 | <h3>1.8.7: Mar 6 2000</h3> |
| 2333 | <ul> |
| 2334 | <li>This is a bug fix release:</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2335 | <li>It is possible to disable the ignorable blanks heuristic used |
| 2336 | bylibxml-1.x, a new function xmlKeepBlanksDefault(0) will allow this. |
| 2337 | Notethat for adherence to XML spec, this behaviour will be disabled |
| 2338 | bydefault in 2.x . The same function will allow to keep compatibility |
| 2339 | forold code.</li> |
| 2340 | <li>Blanks in <a> </a> constructs are not ignored |
| 2341 | anymore,avoiding heuristic is really the Right Way :-\</li> |
| 2342 | <li>The unchecked use of snprintf which was breaking |
| 2343 | libxml-1.8.6compilation on some platforms has been fixed</li> |
| 2344 | <li>nanoftp.c nanohttp.c: Fixed '#' and '?' stripping when |
| 2345 | processingURIs</li> |
Daniel Veillard | f13e1ed | 2000-03-06 07:41:49 +0000 | [diff] [blame] | 2346 | </ul> |
| 2347 | |
Daniel Veillard | e41f2b7 | 2000-01-30 20:00:07 +0000 | [diff] [blame] | 2348 | <h3>1.8.6: Jan 31 2000</h3> |
| 2349 | <ul> |
| 2350 | <li>added a nanoFTP transport module, debugged until the new version of <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2351 | href="http://rpmfind.net/linux/rpm2html/rpmfind.html">rpmfind</a>can |
| 2352 | useit without troubles</li> |
Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 2353 | </ul> |
| 2354 | |
| 2355 | <h3>1.8.5: Jan 21 2000</h3> |
| 2356 | <ul> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 2357 | <li>adding APIs to parse a well balanced chunk of XML (production <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2358 | href="http://www.w3.org/TR/REC-xml#NT-content">[43] content</a>of theXML |
| 2359 | spec)</li> |
Daniel Veillard | 461a66c | 2000-01-18 18:01:01 +0000 | [diff] [blame] | 2360 | <li>fixed a hideous bug in xmlGetProp pointed by Rune.Djurhuus@fast.no</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2361 | <li>Jody Goldberg <jgoldberg@home.com> provided another patch |
| 2362 | tryingto solve the zlib checks problems</li> |
| 2363 | <li>The current state in gnome CVS base is expected to ship as 1.8.5 |
| 2364 | withgnumeric soon</li> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 2365 | </ul> |
| 2366 | |
| 2367 | <h3>1.8.4: Jan 13 2000</h3> |
| 2368 | <ul> |
| 2369 | <li>bug fixes, reintroduced xmlNewGlobalNs(), fixed xmlNewNs()</li> |
| 2370 | <li>all exit() call should have been removed from libxml</li> |
| 2371 | <li>fixed a problem with INCLUDE_WINSOCK on WIN32 platform</li> |
| 2372 | <li>added newDocFragment()</li> |
Daniel Veillard | f84f71f | 2000-01-05 19:54:23 +0000 | [diff] [blame] | 2373 | </ul> |
| 2374 | |
| 2375 | <h3>1.8.3: Jan 5 2000</h3> |
| 2376 | <ul> |
| 2377 | <li>a Push interface for the XML and HTML parsers</li> |
Daniel Veillard | f13e1ed | 2000-03-06 07:41:49 +0000 | [diff] [blame] | 2378 | <li>a shell-like interface to the document tree (try tester --shell :-)</li> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2379 | <li>lots of bug fixes and improvement added over XMas holidays</li> |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 2380 | <li>fixed the DTD parsing code to work with the xhtml DTD</li> |
Daniel Veillard | f84f71f | 2000-01-05 19:54:23 +0000 | [diff] [blame] | 2381 | <li>added xmlRemoveProp(), xmlRemoveID() and xmlRemoveRef()</li> |
| 2382 | <li>Fixed bugs in xmlNewNs()</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2383 | <li>External entity loading code has been revamped, now it |
| 2384 | usesxmlLoadExternalEntity(), some fix on entities processing were |
| 2385 | added</li> |
Daniel Veillard | 437b87b | 2000-01-03 17:30:46 +0000 | [diff] [blame] | 2386 | <li>cleaned up WIN32 includes of socket stuff</li> |
Daniel Veillard | 5cb5ab8 | 1999-12-21 15:35:29 +0000 | [diff] [blame] | 2387 | </ul> |
| 2388 | |
| 2389 | <h3>1.8.2: Dec 21 1999</h3> |
| 2390 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2391 | <li>I got another problem with includes and C++, I hope this issue is |
| 2392 | fixedfor good this time</li> |
| 2393 | <li>Added a few tree modification functions: |
| 2394 | xmlReplaceNode,xmlAddPrevSibling, xmlAddNextSibling, xmlNodeSetName |
| 2395 | andxmlDocSetRootElement</li> |
Daniel Veillard | 5cb5ab8 | 1999-12-21 15:35:29 +0000 | [diff] [blame] | 2396 | <li>Tried to improve the HTML output with help from <a |
| 2397 | href="mailto:clahey@umich.edu">Chris Lahey</a></li> |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 2398 | </ul> |
Daniel Veillard | b24054a | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 2399 | |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 2400 | <h3>1.8.1: Dec 18 1999</h3> |
| 2401 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2402 | <li>various patches to avoid troubles when using libxml with C++ |
| 2403 | compilersthe "namespace" keyword and C escaping in include files</li> |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 2404 | <li>a problem in one of the core macros IS_CHAR was corrected</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2405 | <li>fixed a bug introduced in 1.8.0 breaking default namespace |
| 2406 | processing,and more specifically the Dia application</li> |
| 2407 | <li>fixed a posteriori validation (validation after parsing, or by using |
| 2408 | aDtd not specified in the original document)</li> |
Daniel Veillard | b24054a | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 2409 | <li>fixed a bug in</li> |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 2410 | </ul> |
| 2411 | |
| 2412 | <h3>1.8.0: Dec 12 1999</h3> |
| 2413 | <ul> |
| 2414 | <li>cleanup, especially memory wise</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2415 | <li>the parser should be more reliable, especially the HTML one, it |
| 2416 | shouldnot crash, whatever the input !</li> |
| 2417 | <li>Integrated various patches, especially a speedup improvement for |
| 2418 | largedataset from <a href="mailto:cnygard@bellatlantic.net">Carl |
| 2419 | Nygard</a>,configure with --with-buffers to enable them.</li> |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 2420 | <li>attribute normalization, oops should have been added long ago !</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2421 | <li>attributes defaulted from DTDs should be available, xmlSetProp() |
| 2422 | nowdoes entities escaping by default.</li> |
Daniel Veillard | 4c3a203 | 1999-11-19 17:46:26 +0000 | [diff] [blame] | 2423 | </ul> |
Daniel Veillard | 3500838 | 1999-10-25 13:15:52 +0000 | [diff] [blame] | 2424 | |
| 2425 | <h3>1.7.4: Oct 25 1999</h3> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2426 | <ul> |
Daniel Veillard | 3500838 | 1999-10-25 13:15:52 +0000 | [diff] [blame] | 2427 | <li>Lots of HTML improvement</li> |
| 2428 | <li>Fixed some errors when saving both XML and HTML</li> |
| 2429 | <li>More examples, the regression tests should now look clean</li> |
| 2430 | <li>Fixed a bug with contiguous charref</li> |
| 2431 | </ul> |
| 2432 | |
| 2433 | <h3>1.7.3: Sep 29 1999</h3> |
| 2434 | <ul> |
| 2435 | <li>portability problems fixed</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2436 | <li>snprintf was used unconditionally, leading to link problems on |
| 2437 | systemwere it's not available, fixed</li> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2438 | </ul> |
| 2439 | |
| 2440 | <h3>1.7.1: Sep 24 1999</h3> |
| 2441 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2442 | <li>The basic type for strings manipulated by libxml has been renamed |
| 2443 | in1.7.1 from <strong>CHAR</strong>to <strong>xmlChar</strong>. The |
| 2444 | reasonis that CHAR was conflicting with a predefined type on Windows. |
| 2445 | Howeveron non WIN32 environment, compatibility is provided by the way of |
| 2446 | a<strong>#define </strong>.</li> |
| 2447 | <li>Changed another error : the use of a structure field called errno, |
| 2448 | andleading to troubles on platforms where it's a macro</li> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2449 | </ul> |
| 2450 | |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2451 | <h3>1.7.0: Sep 23 1999</h3> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2452 | <ul> |
| 2453 | <li>Added the ability to fetch remote DTD or parsed entities, see the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2454 | href="html/libxml-nanohttp.html">nanohttp</a>module.</li> |
| 2455 | <li>Added an errno to report errors by another mean than a simple |
| 2456 | printflike callback</li> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2457 | <li>Finished ID/IDREF support and checking when validation</li> |
| 2458 | <li>Serious memory leaks fixed (there is now a <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2459 | href="html/libxml-xmlmemory.html">memory wrapper</a>module)</li> |
| 2460 | <li>Improvement of <a |
| 2461 | href="http://www.w3.org/TR/xpath">XPath</a>implementation</li> |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2462 | <li>Added an HTML parser front-end</li> |
| 2463 | </ul> |
| 2464 | |
| 2465 | <h2><a name="XML">XML</a></h2> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 2466 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2467 | <p><a href="http://www.w3.org/TR/REC-xml">XML is a |
| 2468 | standard</a>formarkup-based structured documents. Here is <a |
| 2469 | name="example">an example XMLdocument</a>:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 2470 | <pre><?xml version="1.0"?> |
| 2471 | <EXAMPLE prop1="gnome is great" prop2="&amp; linux too"> |
| 2472 | <head> |
| 2473 | <title>Welcome to Gnome</title> |
| 2474 | </head> |
| 2475 | <chapter> |
| 2476 | <title>The Linux adventure</title> |
| 2477 | <p>bla bla bla ...</p> |
| 2478 | <image href="linus.gif"/> |
| 2479 | <p>...</p> |
| 2480 | </chapter> |
| 2481 | </EXAMPLE></pre> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 2482 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2483 | <p>The first line specifies that it is an XML document and gives |
| 2484 | usefulinformation about its encoding. Then the rest of the document is a |
| 2485 | textformat whose structure is specified by tags between brackets. |
| 2486 | <strong>Eachtag opened has to be closed</strong>. XML is pedantic about this. |
| 2487 | However, ifa tag is empty (no content), a single tag can serve as both the |
| 2488 | opening andclosing tag if it ends with <code>/></code>rather than |
| 2489 | with<code>></code>. Note that, for example, the image tag has no content |
| 2490 | (justan attribute) and is closed by ending the tag with |
| 2491 | <code>/></code>.</p> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 2492 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2493 | <p>XML can be applied successfully to a wide range of tasks, ranging fromlong |
| 2494 | term structured document maintenance (where it follows the steps ofSGML) to |
| 2495 | simple data encoding mechanisms like configuration file formatting(glade), |
| 2496 | spreadsheets (gnumeric), or even shorter lived documents such asWebDAV where |
| 2497 | it is used to encode remote calls between a client and aserver.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 2498 | |
Daniel Veillard | 8268716 | 2001-01-22 15:32:01 +0000 | [diff] [blame] | 2499 | <h2><a name="XSLT">XSLT</a></h2> |
| 2500 | |
Daniel Veillard | 6e6a6cc | 2001-02-15 15:55:44 +0000 | [diff] [blame] | 2501 | <p>Check <a href="http://xmlsoft.org/XSLT">the separate libxslt page</a></p> |
| 2502 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2503 | <p><a href="http://www.w3.org/TR/xslt">XSL Transformations</a>, is alanguage |
| 2504 | for transforming XML documents into other XML documents (orHTML/textual |
| 2505 | output).</p> |
Daniel Veillard | 8268716 | 2001-01-22 15:32:01 +0000 | [diff] [blame] | 2506 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2507 | <p>A separate library called libxslt is available implementing XSLT-1.0 |
| 2508 | forlibxml2. This module "libxslt" too can be found in the Gnome CVS base.</p> |
Daniel Veillard | 8268716 | 2001-01-22 15:32:01 +0000 | [diff] [blame] | 2509 | |
Daniel Veillard | 29f6100 | 2005-08-06 09:07:15 +0000 | [diff] [blame] | 2510 | <p>You can check the progresses on the libxslt <a |
| 2511 | href="http://xmlsoft.org/XSLT/ChangeLog.html">Changelog</a>.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2512 | |
| 2513 | <h2><a name="Python">Python and bindings</a></h2> |
| 2514 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2515 | <p>There are a number of language bindings and wrappers available forlibxml2, |
| 2516 | the list below is not exhaustive. Please contact the <a |
| 2517 | href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a>(<a |
| 2518 | href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) inorder to |
| 2519 | get updates to this list or to discuss the specific topic of libxml2or |
| 2520 | libxslt wrappers or bindings:</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2521 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2522 | <li><a href="http://libxmlplusplus.sourceforge.net/">Libxml++</a>seems |
| 2523 | themost up-to-date C++ bindings for libxml2, check the <a |
| 2524 | href="http://libxmlplusplus.sourceforge.net/reference/html/hierarchy.html">documentation</a>and |
| 2525 | the <a |
Daniel Veillard | c14401e | 2002-11-20 14:28:17 +0000 | [diff] [blame] | 2526 | href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/libxmlplusplus/libxml%2b%2b/examples/">examples</a>.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2527 | <li>There is another <a href="http://libgdome-cpp.berlios.de/">C++ |
| 2528 | wrapperbased on the gdome2 bindings</a>maintained by Tobias Peters.</li> |
Daniel Veillard | 9b6fd30 | 2002-05-13 12:06:47 +0000 | [diff] [blame] | 2529 | <li>and a third C++ wrapper by Peter Jones <pjones@pmade.org> |
| 2530 | <p>Website: <a |
| 2531 | href="http://pmade.org/pjones/software/xmlwrapp/">http://pmade.org/pjones/software/xmlwrapp/</a></p> |
| 2532 | </li> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2533 | <li><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2534 | href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">MattSergeant</a>developed |
| 2535 | <a href="http://axkit.org/download/">XML::LibXSLT</a>, a Perl wrapper |
| 2536 | forlibxml2/libxslt as part of the <a href="http://axkit.com/">AxKit |
| 2537 | XMLapplication server</a>.</li> |
Daniel Veillard | 4ac494b | 2003-09-18 15:08:00 +0000 | [diff] [blame] | 2538 | <li>If you're interested into scripting XML processing, have a look at <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2539 | href="http://xsh.sourceforge.net/">XSH</a>an XML editing shell based |
| 2540 | onLibxml2 Perl bindings.</li> |
| 2541 | <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a>provides |
| 2542 | anearlier version of the libxml/libxslt <a |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 2543 | href="http://www.rexx.com/~dkuhlman">wrappers for Python</a>.</li> |
Daniel Veillard | 2147367 | 2002-06-17 07:29:22 +0000 | [diff] [blame] | 2544 | <li>Gopal.V and Peter Minten develop <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2545 | href="http://savannah.gnu.org/projects/libxmlsharp">libxml#</a>, a set |
| 2546 | ofC# libxml2 bindings.</li> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2547 | <li>Petr Kozelka provides <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2548 | href="http://sourceforge.net/projects/libxml2-pas">Pascal units to |
| 2549 | gluelibxml2</a>with Kylix, Delphi and other Pascal compilers.</li> |
Daniel Veillard | b2fb8ed | 2002-04-01 09:33:12 +0000 | [diff] [blame] | 2550 | <li>Uwe Fechner also provides <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2551 | href="http://sourceforge.net/projects/idom2-pas/">idom2</a>, a |
| 2552 | DOM2implementation for Kylix2/D5/D6 from Borland.</li> |
| 2553 | <li>There is <a href="http://libxml.rubyforge.org/">bindings for |
| 2554 | Ruby</a>and libxml2 bindings are also available in Ruby through the <a |
| 2555 | href="http://libgdome-ruby.berlios.de/">libgdome-ruby</a>modulemaintained |
| 2556 | by Tobias Peters.</li> |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 2557 | <li>Steve Ball and contributors maintains <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2558 | href="http://tclxml.sourceforge.net/">libxml2 and libxslt bindings |
| 2559 | forTcl</a>.</li> |
Daniel Veillard | 142fb21 | 2005-04-07 12:48:10 +0000 | [diff] [blame] | 2560 | <li>libxml2 and libxslt is the default XML library for PHP5.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2561 | <li><a href="http://savannah.gnu.org/projects/classpathx/">LibxmlJ</a>isan |
| 2562 | effort to create a 100% JAXP-compatible Java wrapper for libxml2 |
| 2563 | andlibxslt as part of GNU ClasspathX project.</li> |
| 2564 | <li>Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look |
| 2565 | for<a href="http://www.interlog.com/~ptjm/software.html">RexxXML</a>.</li> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 2566 | <li><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2567 | href="http://www.satimage.fr/software/en/xml_suite.html">Satimage</a>provides |
| 2568 | <a |
| 2569 | href="http://www.satimage.fr/software/en/downloads_osaxen.html">XMLLibosax</a>. |
| 2570 | This is an osax for Mac OS X with a set of commands toimplement in |
| 2571 | AppleScript the XML DOM, XPATH and XSLT. Also includescommands for |
| 2572 | Property-lists (Apple's fast lookup table XML format.)</li> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 2573 | <li>Francesco Montorsi developped <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2574 | href="https://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182">wxXml2</a>wrappers |
| 2575 | that interface libxml2, allowing wxWidgets applications toload/save/edit |
| 2576 | XML instances.</li> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2577 | </ul> |
| 2578 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2579 | <p>The distribution includes a set of Python bindings, which are guaranteedto |
| 2580 | be maintained as part of the library in the future, though the |
| 2581 | Pythoninterface have not yet reached the completeness of the C API.</p> |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 2582 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2583 | <p>Note that some of the Python purist dislike the default set of |
| 2584 | Pythonbindings, rather than complaining I suggest they have a look at <a |
| 2585 | href="http://codespeak.net/lxml/">lxml the more pythonic bindings for |
| 2586 | libxml2and libxslt</a>and <a |
| 2587 | href="http://codespeak.net/mailman/listinfo/lxml-dev">help |
| 2588 | MartijnFaassen</a>complete those.</p> |
Daniel Veillard | 929746e | 2005-05-11 11:08:22 +0000 | [diff] [blame] | 2589 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2590 | <p><a href="mailto:stephane.bidoul@softwareag.com">Stéphane |
| 2591 | Bidoul</a>maintains <a href="http://users.skynet.be/sbi/libxml-python/">a |
| 2592 | Windows portof the Python bindings</a>.</p> |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 2593 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2594 | <p>Note to people interested in building bindings, the API is formalized as<a |
| 2595 | href="libxml2-api.xml">an XML API description file</a>which allows toautomate |
| 2596 | a large part of the Python bindings, this includes functiondescriptions, |
| 2597 | enums, structures, typedefs, etc... The Python script used tobuild the |
| 2598 | bindings is python/generator.py in the source distribution.</p> |
Daniel Veillard | 7ef0fcb | 2002-12-14 10:38:55 +0000 | [diff] [blame] | 2599 | |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 2600 | <p>To install the Python bindings there are 2 options:</p> |
Daniel Veillard | 0b79dfe | 2002-02-23 13:02:31 +0000 | [diff] [blame] | 2601 | <ul> |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 2602 | <li>If you use an RPM based distribution, simply install the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2603 | href="http://rpmfind.net/linux/rpm2html/search.php?query=libxml2-python">libxml2-pythonRPM</a>(and |
| 2604 | if needed the <a |
| 2605 | href="http://rpmfind.net/linux/rpm2html/search.php?query=libxslt-python">libxslt-pythonRPM</a>).</li> |
| 2606 | <li>Otherwise use the <a |
| 2607 | href="ftp://xmlsoft.org/libxml2/python/">libxml2-pythonmodule |
| 2608 | distribution</a>corresponding to your installed version oflibxml2 and |
| 2609 | libxslt. Note that to install it you will need both libxml2and libxslt |
| 2610 | installed and run "python setup.py build install" in themodule tree.</li> |
Daniel Veillard | 0b79dfe | 2002-02-23 13:02:31 +0000 | [diff] [blame] | 2611 | </ul> |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 2612 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2613 | <p>The distribution includes a set of examples and regression tests for |
| 2614 | thepython bindings in the <code>python/tests</code>directory. Here are |
| 2615 | someexcerpts from those tests:</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2616 | |
| 2617 | <h3>tst.py:</h3> |
| 2618 | |
| 2619 | <p>This is a basic test of the file interface and DOM navigation:</p> |
MST 2003 John Fleck | 2dffb76 | 2003-11-29 04:41:24 +0000 | [diff] [blame] | 2620 | <pre>import libxml2, sys |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2621 | |
| 2622 | doc = libxml2.parseFile("tst.xml") |
| 2623 | if doc.name != "tst.xml": |
| 2624 | print "doc.name failed" |
| 2625 | sys.exit(1) |
| 2626 | root = doc.children |
| 2627 | if root.name != "doc": |
| 2628 | print "root.name failed" |
| 2629 | sys.exit(1) |
| 2630 | child = root.children |
| 2631 | if child.name != "foo": |
| 2632 | print "child.name failed" |
| 2633 | sys.exit(1) |
| 2634 | doc.freeDoc()</pre> |
| 2635 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2636 | <p>The Python module is called libxml2; parseFile is the equivalent |
| 2637 | ofxmlParseFile (most of the bindings are automatically generated, and the |
| 2638 | xmlprefix is removed and the casing convention are kept). All node seen at |
| 2639 | thebinding level share the same subset of accessors:</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2640 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2641 | <li><code>name</code>: returns the node name</li> |
| 2642 | <li><code>type</code>: returns a string indicating the node type</li> |
| 2643 | <li><code>content</code>: returns the content of the node, it is based |
| 2644 | onxmlNodeGetContent() and hence is recursive.</li> |
| 2645 | <li><code>parent</code>, <code>children</code>, |
| 2646 | <code>last</code>,<code>next</code>, <code>prev</code>, |
| 2647 | <code>doc</code>,<code>properties</code>: pointing to the associated |
| 2648 | element in the tree,those may return None in case no such link |
| 2649 | exists.</li> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2650 | </ul> |
| 2651 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2652 | <p>Also note the need to explicitly deallocate documents with freeDoc() |
| 2653 | .Reference counting for libxml2 trees would need quite a lot of work |
| 2654 | tofunction properly, and rather than risk memory leaks if not |
| 2655 | implementedcorrectly it sounds safer to have an explicit function to free a |
| 2656 | tree. Thewrapper python objects like doc, root or child are them |
| 2657 | automatically garbagecollected.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2658 | |
| 2659 | <h3>validate.py:</h3> |
| 2660 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2661 | <p>This test check the validation interfaces and redirection of |
| 2662 | errormessages:</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2663 | <pre>import libxml2 |
| 2664 | |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2665 | #deactivate error messages from the validation |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2666 | def noerr(ctx, str): |
| 2667 | pass |
| 2668 | |
| 2669 | libxml2.registerErrorHandler(noerr, None) |
| 2670 | |
| 2671 | ctxt = libxml2.createFileParserCtxt("invalid.xml") |
| 2672 | ctxt.validate(1) |
| 2673 | ctxt.parseDocument() |
| 2674 | doc = ctxt.doc() |
| 2675 | valid = ctxt.isValid() |
| 2676 | doc.freeDoc() |
| 2677 | if valid != 0: |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2678 | print "validity check failed"</pre> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2679 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2680 | <p>The first thing to notice is the call to registerErrorHandler(), itdefines |
| 2681 | a new error handler global to the library. It is used to avoid seeingthe |
| 2682 | error messages when trying to validate the invalid document.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2683 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2684 | <p>The main interest of that test is the creation of a parser context |
| 2685 | withcreateFileParserCtxt() and how the behaviour can be changed before |
| 2686 | callingparseDocument() . Similarly the informations resulting from the |
| 2687 | parsing phaseare also available using context methods.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2688 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2689 | <p>Contexts like nodes are defined as class and the libxml2 wrappers maps |
| 2690 | theC function interfaces in terms of objects method as much as possible. |
| 2691 | Thebest to get a complete view of what methods are supported is to look at |
| 2692 | thelibxml2.py module containing all the wrappers.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2693 | |
| 2694 | <h3>push.py:</h3> |
| 2695 | |
| 2696 | <p>This test show how to activate the push parser interface:</p> |
| 2697 | <pre>import libxml2 |
| 2698 | |
| 2699 | ctxt = libxml2.createPushParser(None, "<foo", 4, "test.xml") |
| 2700 | ctxt.parseChunk("/>", 2, 1) |
| 2701 | doc = ctxt.doc() |
| 2702 | |
| 2703 | doc.freeDoc()</pre> |
| 2704 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2705 | <p>The context is created with a special call based on |
| 2706 | thexmlCreatePushParser() from the C library. The first argument is an |
| 2707 | optionalSAX callback object, then the initial set of data, the length and the |
| 2708 | name ofthe resource in case URI-References need to be computed by the |
| 2709 | parser.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2710 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2711 | <p>Then the data are pushed using the parseChunk() method, the last |
| 2712 | callsetting the third argument terminate to 1.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2713 | |
| 2714 | <h3>pushSAX.py:</h3> |
| 2715 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2716 | <p>this test show the use of the event based parsing interfaces. In this |
| 2717 | casethe parser does not build a document, but provides callback information |
| 2718 | asthe parser makes progresses analyzing the data being provided:</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2719 | <pre>import libxml2 |
| 2720 | log = "" |
| 2721 | |
| 2722 | class callback: |
| 2723 | def startDocument(self): |
| 2724 | global log |
| 2725 | log = log + "startDocument:" |
| 2726 | |
| 2727 | def endDocument(self): |
| 2728 | global log |
| 2729 | log = log + "endDocument:" |
| 2730 | |
| 2731 | def startElement(self, tag, attrs): |
| 2732 | global log |
| 2733 | log = log + "startElement %s %s:" % (tag, attrs) |
| 2734 | |
| 2735 | def endElement(self, tag): |
| 2736 | global log |
| 2737 | log = log + "endElement %s:" % (tag) |
| 2738 | |
| 2739 | def characters(self, data): |
| 2740 | global log |
| 2741 | log = log + "characters: %s:" % (data) |
| 2742 | |
| 2743 | def warning(self, msg): |
| 2744 | global log |
| 2745 | log = log + "warning: %s:" % (msg) |
| 2746 | |
| 2747 | def error(self, msg): |
| 2748 | global log |
| 2749 | log = log + "error: %s:" % (msg) |
| 2750 | |
| 2751 | def fatalError(self, msg): |
| 2752 | global log |
| 2753 | log = log + "fatalError: %s:" % (msg) |
| 2754 | |
| 2755 | handler = callback() |
| 2756 | |
| 2757 | ctxt = libxml2.createPushParser(handler, "<foo", 4, "test.xml") |
| 2758 | chunk = " url='tst'>b" |
| 2759 | ctxt.parseChunk(chunk, len(chunk), 0) |
| 2760 | chunk = "ar</foo>" |
| 2761 | ctxt.parseChunk(chunk, len(chunk), 1) |
| 2762 | |
Daniel Veillard | fcbfa2d | 2002-02-21 17:54:27 +0000 | [diff] [blame] | 2763 | reference = "startDocument:startElement foo {'url': 'tst'}:" + \ |
| 2764 | "characters: bar:endElement foo:endDocument:" |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2765 | if log != reference: |
| 2766 | print "Error got: %s" % log |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2767 | print "Expected: %s" % reference</pre> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2768 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2769 | <p>The key object in that test is the handler, it provides a number of |
| 2770 | entrypoints which can be called by the parser as it makes progresses to |
| 2771 | indicatethe information set obtained. The full set of callback is larger than |
| 2772 | whatthe callback class in that specific example implements (see the |
| 2773 | SAXdefinition for a complete list). The wrapper will only call those supplied |
| 2774 | bythe object when activated. The startElement receives the names of the |
| 2775 | elementand a dictionary containing the attributes carried by this element.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2776 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2777 | <p>Also note that the reference string generated from the callback shows |
| 2778 | asingle character call even though the string "bar" is passed to the |
| 2779 | parserfrom 2 different call to parseChunk()</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2780 | |
| 2781 | <h3>xpath.py:</h3> |
| 2782 | |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 2783 | <p>This is a basic test of XPath wrappers support</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2784 | <pre>import libxml2 |
| 2785 | |
| 2786 | doc = libxml2.parseFile("tst.xml") |
| 2787 | ctxt = doc.xpathNewContext() |
| 2788 | res = ctxt.xpathEval("//*") |
| 2789 | if len(res) != 2: |
| 2790 | print "xpath query: wrong node set size" |
| 2791 | sys.exit(1) |
| 2792 | if res[0].name != "doc" or res[1].name != "foo": |
| 2793 | print "xpath query: wrong node set value" |
| 2794 | sys.exit(1) |
| 2795 | doc.freeDoc() |
| 2796 | ctxt.xpathFreeContext()</pre> |
| 2797 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2798 | <p>This test parses a file, then create an XPath context to evaluate |
| 2799 | XPathexpression on it. The xpathEval() method execute an XPath query and |
| 2800 | returnsthe result mapped in a Python way. String and numbers are natively |
| 2801 | converted,and node sets are returned as a tuple of libxml2 Python nodes |
| 2802 | wrappers. Likethe document, the XPath context need to be freed explicitly, |
| 2803 | also not thatthe result of the XPath query may point back to the document |
| 2804 | tree and hencethe document must be freed after the result of the query is |
| 2805 | used.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2806 | |
| 2807 | <h3>xpathext.py:</h3> |
| 2808 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2809 | <p>This test shows how to extend the XPath engine with functions written |
| 2810 | inpython:</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2811 | <pre>import libxml2 |
| 2812 | |
| 2813 | def foo(ctx, x): |
| 2814 | return x + 1 |
| 2815 | |
| 2816 | doc = libxml2.parseFile("tst.xml") |
| 2817 | ctxt = doc.xpathNewContext() |
| 2818 | libxml2.registerXPathFunction(ctxt._o, "foo", None, foo) |
| 2819 | res = ctxt.xpathEval("foo(1)") |
| 2820 | if res != 2: |
| 2821 | print "xpath extension failure" |
| 2822 | doc.freeDoc() |
| 2823 | ctxt.xpathFreeContext()</pre> |
| 2824 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2825 | <p>Note how the extension function is registered with the context (but |
| 2826 | thatpart is not yet finalized, this may change slightly in the future).</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2827 | |
| 2828 | <h3>tstxpath.py:</h3> |
| 2829 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2830 | <p>This test is similar to the previous one but shows how the |
| 2831 | extensionfunction can access the XPath evaluation context:</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2832 | <pre>def foo(ctx, x): |
| 2833 | global called |
| 2834 | |
| 2835 | # |
| 2836 | # test that access to the XPath evaluation contexts |
| 2837 | # |
| 2838 | pctxt = libxml2.xpathParserContext(_obj=ctx) |
| 2839 | ctxt = pctxt.context() |
| 2840 | called = ctxt.function() |
| 2841 | return x + 1</pre> |
| 2842 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2843 | <p>All the interfaces around the XPath parser(or rather evaluation) |
| 2844 | contextare not finalized, but it should be sufficient to do contextual work |
| 2845 | at theevaluation point.</p> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2846 | |
| 2847 | <h3>Memory debugging:</h3> |
| 2848 | |
| 2849 | <p>last but not least, all tests starts with the following prologue:</p> |
| 2850 | <pre>#memory debug specific |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 2851 | libxml2.debugMemory(1)</pre> |
Daniel Veillard | 6dbcaf8 | 2002-02-20 14:37:47 +0000 | [diff] [blame] | 2852 | |
| 2853 | <p>and ends with the following epilogue:</p> |
| 2854 | <pre>#memory debug specific |
| 2855 | libxml2.cleanupParser() |
| 2856 | if libxml2.debugMemory(1) == 0: |
| 2857 | print "OK" |
| 2858 | else: |
| 2859 | print "Memory leak %d bytes" % (libxml2.debugMemory(1)) |
| 2860 | libxml2.dumpMemory()</pre> |
| 2861 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2862 | <p>Those activate the memory debugging interface of libxml2 where |
| 2863 | allallocated block in the library are tracked. The prologue then cleans up |
| 2864 | thelibrary state and checks that all allocated memory has been freed. If not |
| 2865 | itcalls dumpMemory() which saves that list in a <code>.memdump</code>file.</p> |
Daniel Veillard | 8268716 | 2001-01-22 15:32:01 +0000 | [diff] [blame] | 2866 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 2867 | <h2><a name="architecture">libxml2 architecture</a></h2> |
Daniel Veillard | 4540be4 | 2000-08-19 16:40:28 +0000 | [diff] [blame] | 2868 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2869 | <p>Libxml2 is made of multiple components; some of them are optional, andmost |
| 2870 | of the block interfaces are public. The main components are:</p> |
Daniel Veillard | 4540be4 | 2000-08-19 16:40:28 +0000 | [diff] [blame] | 2871 | <ul> |
| 2872 | <li>an Input/Output layer</li> |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 2873 | <li>FTP and HTTP client layers (optional)</li> |
Daniel Veillard | 4540be4 | 2000-08-19 16:40:28 +0000 | [diff] [blame] | 2874 | <li>an Internationalization layer managing the encodings support</li> |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 2875 | <li>a URI module</li> |
Daniel Veillard | 4540be4 | 2000-08-19 16:40:28 +0000 | [diff] [blame] | 2876 | <li>the XML parser and its basic SAX interface</li> |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 2877 | <li>an HTML parser using the same SAX interface (optional)</li> |
Daniel Veillard | 4540be4 | 2000-08-19 16:40:28 +0000 | [diff] [blame] | 2878 | <li>a SAX tree module to build an in-memory DOM representation</li> |
| 2879 | <li>a tree module to manipulate the DOM representation</li> |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 2880 | <li>a validation module using the DOM representation (optional)</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2881 | <li>an XPath module for global lookup in a DOM representation(optional)</li> |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 2882 | <li>a debug module (optional)</li> |
Daniel Veillard | 4540be4 | 2000-08-19 16:40:28 +0000 | [diff] [blame] | 2883 | </ul> |
| 2884 | |
| 2885 | <p>Graphically this gives the following:</p> |
| 2886 | |
| 2887 | <p><img src="libxml.gif" alt="a graphical view of the various"></p> |
| 2888 | |
| 2889 | <p></p> |
| 2890 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2891 | <h2><a name="tree">The tree output</a></h2> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 2892 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2893 | <p>The parser returns a tree built during the document analysis. The |
| 2894 | valuereturned is an <strong>xmlDocPtr</strong>(i.e., a pointer to |
| 2895 | an<strong>xmlDoc</strong>structure). This structure contains information |
| 2896 | suchas the file name, the document type, and a |
| 2897 | <strong>children</strong>pointerwhich is the root of the document (or more |
| 2898 | exactly the first child under theroot which is the document). The tree is |
| 2899 | made of <strong>xmlNode</strong>s,chained in double-linked lists of siblings |
| 2900 | and with a children<->parentrelationship. An xmlNode can also carry |
| 2901 | properties (a chain of xmlAttrstructures). An attribute may have a value |
| 2902 | which is a list of TEXT orENTITY_REF nodes.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 2903 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2904 | <p>Here is an example (erroneous with respect to the XML spec since |
| 2905 | thereshould be only one ELEMENT under the root):</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 2906 | |
| 2907 | <p><img src="structure.gif" alt=" structure.gif "></p> |
| 2908 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2909 | <p>In the source package there is a small program (not installed by |
| 2910 | default)called <strong>xmllint</strong>which parses XML files given as |
| 2911 | argument andprints them back as parsed. This is useful for detecting errors |
| 2912 | both in XMLcode and in the XML parser itself. It has an option |
| 2913 | <strong>--debug</strong>which prints the actual in-memory structure of the |
| 2914 | document; here is theresult with the <a href="#example">example</a>given |
| 2915 | before:</p> |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 2916 | <pre>DOCUMENT |
| 2917 | version=1.0 |
| 2918 | standalone=true |
| 2919 | ELEMENT EXAMPLE |
| 2920 | ATTRIBUTE prop1 |
| 2921 | TEXT |
| 2922 | content=gnome is great |
| 2923 | ATTRIBUTE prop2 |
| 2924 | ENTITY_REF |
| 2925 | TEXT |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 2926 | content= linux too |
Daniel Veillard | 402e8c8 | 2000-02-29 22:57:47 +0000 | [diff] [blame] | 2927 | ELEMENT head |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 2928 | ELEMENT title |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 2929 | TEXT |
| 2930 | content=Welcome to Gnome |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 2931 | ELEMENT chapter |
| 2932 | ELEMENT title |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 2933 | TEXT |
| 2934 | content=The Linux adventure |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 2935 | ELEMENT p |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 2936 | TEXT |
| 2937 | content=bla bla bla ... |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 2938 | ELEMENT image |
| 2939 | ATTRIBUTE href |
| 2940 | TEXT |
| 2941 | content=linus.gif |
| 2942 | ELEMENT p |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 2943 | TEXT |
| 2944 | content=...</pre> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 2945 | |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 2946 | <p>This should be useful for learning the internal representation model.</p> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 2947 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 2948 | <h2><a name="interface">The SAX interface</a></h2> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 2949 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2950 | <p>Sometimes the DOM tree output is just too large to fit reasonably |
| 2951 | intomemory. In that case (and if you don't expect to save back the XML |
| 2952 | documentloaded using libxml), it's better to use the SAX interface of libxml. |
| 2953 | SAX isa <strong>callback-based interface</strong>to the parser. Before |
| 2954 | parsing,the application layer registers a customized set of callbacks which |
| 2955 | arecalled by the library as it progresses through the XML input.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 2956 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2957 | <p>To get more detailed step-by-step guidance on using the SAX interface |
| 2958 | oflibxml, see the <a |
| 2959 | href="http://www.daa.com.au/~james/gnome/xml-sax/xml-sax.html">nicedocumentation</a>.written |
| 2960 | by <a href="mailto:james@daa.com.au">JamesHenstridge</a>.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 2961 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 2962 | <p>You can debug the SAX behaviour by using the |
| 2963 | <strong>testSAX</strong>program located in the gnome-xml module (it's usually |
| 2964 | not shipped in thebinary packages of libxml, but you can find it in the tar |
| 2965 | sourcedistribution). Here is the sequence of callbacks that would be reported |
| 2966 | bytestSAX when parsing the example XML document shown earlier:</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 2967 | <pre>SAX.setDocumentLocator() |
| 2968 | SAX.startDocument() |
| 2969 | SAX.getEntity(amp) |
| 2970 | SAX.startElement(EXAMPLE, prop1='gnome is great', prop2='&amp; linux too') |
| 2971 | SAX.characters( , 3) |
| 2972 | SAX.startElement(head) |
| 2973 | SAX.characters( , 4) |
| 2974 | SAX.startElement(title) |
| 2975 | SAX.characters(Welcome to Gnome, 16) |
| 2976 | SAX.endElement(title) |
| 2977 | SAX.characters( , 3) |
| 2978 | SAX.endElement(head) |
| 2979 | SAX.characters( , 3) |
| 2980 | SAX.startElement(chapter) |
| 2981 | SAX.characters( , 4) |
| 2982 | SAX.startElement(title) |
| 2983 | SAX.characters(The Linux adventure, 19) |
| 2984 | SAX.endElement(title) |
| 2985 | SAX.characters( , 4) |
| 2986 | SAX.startElement(p) |
| 2987 | SAX.characters(bla bla bla ..., 15) |
| 2988 | SAX.endElement(p) |
| 2989 | SAX.characters( , 4) |
| 2990 | SAX.startElement(image, href='linus.gif') |
| 2991 | SAX.endElement(image) |
| 2992 | SAX.characters( , 4) |
| 2993 | SAX.startElement(p) |
| 2994 | SAX.characters(..., 3) |
| 2995 | SAX.endElement(p) |
| 2996 | SAX.characters( , 3) |
| 2997 | SAX.endElement(chapter) |
| 2998 | SAX.characters( , 1) |
| 2999 | SAX.endElement(EXAMPLE) |
| 3000 | SAX.endDocument()</pre> |
| 3001 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3002 | <p>Most of the other interfaces of libxml2 are based on the DOM |
| 3003 | tree-buildingfacility, so nearly everything up to the end of this document |
| 3004 | presupposes theuse of the standard DOM tree build. Note that the DOM tree |
| 3005 | itself is built bya set of registered default callbacks, without internal |
| 3006 | specificinterface.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 3007 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3008 | <h2><a name="Validation">Validation & DTDs</a></h2> |
| 3009 | |
| 3010 | <p>Table of Content:</p> |
| 3011 | <ol> |
| 3012 | <li><a href="#General5">General overview</a></li> |
| 3013 | <li><a href="#definition">The definition</a></li> |
| 3014 | <li><a href="#Simple">Simple rules</a> |
| 3015 | <ol> |
Daniel Veillard | 9c46682 | 2001-10-25 12:03:39 +0000 | [diff] [blame] | 3016 | <li><a href="#reference">How to reference a DTD from a document</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3017 | <li><a href="#Declaring">Declaring elements</a></li> |
| 3018 | <li><a href="#Declaring1">Declaring attributes</a></li> |
| 3019 | </ol> |
| 3020 | </li> |
| 3021 | <li><a href="#Some">Some examples</a></li> |
| 3022 | <li><a href="#validate">How to validate</a></li> |
| 3023 | <li><a href="#Other">Other resources</a></li> |
| 3024 | </ol> |
| 3025 | |
| 3026 | <h3><a name="General5">General overview</a></h3> |
| 3027 | |
| 3028 | <p>Well what is validation and what is a DTD ?</p> |
| 3029 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3030 | <p>DTD is the acronym for Document Type Definition. This is a description |
| 3031 | ofthe content for a family of XML files. This is part of the XML |
| 3032 | 1.0specification, and allows one to describe and verify that a given |
| 3033 | documentinstance conforms to the set of rules detailing its structure and |
| 3034 | content.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3035 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3036 | <p>Validation is the process of checking a document against a DTD |
| 3037 | (moregenerally against a set of construction rules).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3038 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3039 | <p>The validation process and building DTDs are the two most difficult |
| 3040 | partsof the XML life cycle. Briefly a DTD defines all the possible elements |
| 3041 | to befound within your document, what is the formal shape of your document |
| 3042 | tree(by defining the allowed content of an element; either text, a |
| 3043 | regularexpression for the allowed list of children, or mixed content i.e. |
| 3044 | both textand children). The DTD also defines the valid attributes for all |
| 3045 | elements andthe types of those attributes.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3046 | |
| 3047 | <h3><a name="definition1">The definition</a></h3> |
| 3048 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3049 | <p>The <a href="http://www.w3.org/TR/REC-xml">W3C XML Recommendation</a>(<a |
| 3050 | href="http://www.xml.com/axml/axml.html">Tim Bray's annotated version |
| 3051 | ofRev1</a>):</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3052 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3053 | <li><a |
| 3054 | href="http://www.w3.org/TR/REC-xml#elemdecls">Declaringelements</a></li> |
| 3055 | <li><a |
| 3056 | href="http://www.w3.org/TR/REC-xml#attdecls">Declaringattributes</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3057 | </ul> |
| 3058 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3059 | <p>(unfortunately) all this is inherited from the SGML world, the syntax |
| 3060 | isancient...</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3061 | |
| 3062 | <h3><a name="Simple1">Simple rules</a></h3> |
| 3063 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3064 | <p>Writing DTDs can be done in many ways. The rules to build them if you |
| 3065 | needsomething permanent or something which can evolve over time can be |
| 3066 | radicallydifferent. Really complex DTDs like DocBook ones are flexible but |
| 3067 | quiteharder to design. I will just focus on DTDs for a formats with a fixed |
| 3068 | simplestructure. It is just a set of basic rules, and definitely not |
| 3069 | exhaustive norusable for complex DTD design.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3070 | |
| 3071 | <h4><a name="reference1">How to reference a DTD from a document</a>:</h4> |
| 3072 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3073 | <p>Assuming the top element of the document is <code>spec</code>and the dtdis |
| 3074 | placed in the file <code>mydtd</code>in the subdirectory<code>dtds</code>of |
| 3075 | the directory from where the document were loaded:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3076 | |
| 3077 | <p><code><!DOCTYPE spec SYSTEM "dtds/mydtd"></code></p> |
| 3078 | |
| 3079 | <p>Notes:</p> |
| 3080 | <ul> |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 3081 | <li>The system string is actually an URI-Reference (as defined in <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3082 | href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>) so you can use |
| 3083 | afull URL string indicating the location of your DTD on the Web. This is |
| 3084 | areally good thing to do if you want others to validate your |
| 3085 | document.</li> |
| 3086 | <li>It is also possible to associate a <code>PUBLIC</code>identifier |
| 3087 | (amagic string) so that the DTD is looked up in catalogs on the client |
| 3088 | sidewithout having to locate it on the web.</li> |
| 3089 | <li>A DTD contains a set of element and attribute declarations, but |
| 3090 | theydon't define what the root of the document should be. This is |
| 3091 | explicitlytold to the parser/validator as the first element of |
| 3092 | the<code>DOCTYPE</code>declaration.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3093 | </ul> |
| 3094 | |
| 3095 | <h4><a name="Declaring2">Declaring elements</a>:</h4> |
| 3096 | |
| 3097 | <p>The following declares an element <code>spec</code>:</p> |
| 3098 | |
| 3099 | <p><code><!ELEMENT spec (front, body, back?)></code></p> |
| 3100 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3101 | <p>It also expresses that the spec element contains one |
| 3102 | <code>front</code>,one <code>body</code>and one optional |
| 3103 | <code>back</code>children elements inthis order. The declaration of one |
| 3104 | element of the structure and its contentare done in a single declaration. |
| 3105 | Similarly the following declares<code>div1</code>elements:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3106 | |
Daniel Veillard | 5173727 | 2002-01-23 23:10:38 +0000 | [diff] [blame] | 3107 | <p><code><!ELEMENT div1 (head, (p | list | note)*, div2?)></code></p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3108 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3109 | <p>which means div1 contains one <code>head</code>then a series of |
| 3110 | optional<code>p</code>, <code>list</code>s and <code>note</code>s and then |
| 3111 | anoptional <code>div2</code>. And last but not least an element can |
| 3112 | containtext:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3113 | |
| 3114 | <p><code><!ELEMENT b (#PCDATA)></code></p> |
| 3115 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3116 | <p><code>b</code>contains text or being of mixed content (text and elementsin |
| 3117 | no particular order):</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3118 | |
| 3119 | <p><code><!ELEMENT p (#PCDATA|a|ul|b|i|em)*></code></p> |
| 3120 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3121 | <p><code>p </code>can contain text or <code>a</code>, |
| 3122 | <code>ul</code>,<code>b</code>, <code>i </code>or <code>em</code>elements in |
| 3123 | no particularorder.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3124 | |
| 3125 | <h4><a name="Declaring1">Declaring attributes</a>:</h4> |
| 3126 | |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 3127 | <p>Again the attributes declaration includes their content definition:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3128 | |
| 3129 | <p><code><!ATTLIST termdef name CDATA #IMPLIED></code></p> |
| 3130 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3131 | <p>means that the element <code>termdef</code>can have a |
| 3132 | <code>name</code>attribute containing text (<code>CDATA</code>) and which is |
| 3133 | optional(<code>#IMPLIED</code>). The attribute value can also be defined |
| 3134 | within aset:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3135 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3136 | <p><code><!ATTLIST list type |
| 3137 | (bullets|ordered|glossary)"ordered"></code></p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3138 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3139 | <p>means <code>list</code>element have a <code>type</code>attribute with |
| 3140 | 3allowed values "bullets", "ordered" or "glossary" and which default |
| 3141 | to"ordered" if the attribute is not explicitly specified.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3142 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3143 | <p>The content type of an attribute can be text |
| 3144 | (<code>CDATA</code>),anchor/reference/references(<code>ID</code>/<code>IDREF</code>/<code>IDREFS</code>), |
| 3145 | entity(ies)(<code>ENTITY</code>/<code>ENTITIES</code>) or |
| 3146 | name(s)(<code>NMTOKEN</code>/<code>NMTOKENS</code>). The following defines |
| 3147 | that a<code>chapter</code>element can have an optional |
| 3148 | <code>id</code>attributeof type <code>ID</code>, usable for reference from |
| 3149 | attribute of typeIDREF:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3150 | |
| 3151 | <p><code><!ATTLIST chapter id ID #IMPLIED></code></p> |
| 3152 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3153 | <p>The last value of an attribute definition can be |
| 3154 | <code>#REQUIRED</code>meaning that the attribute has to be given, |
| 3155 | <code>#IMPLIED</code>meaning that it is optional, or the default value |
| 3156 | (possibly prefixed by<code>#FIXED</code>if it is the only allowed).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3157 | |
| 3158 | <p>Notes:</p> |
| 3159 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3160 | <li>Usually the attributes pertaining to a given element are declared in |
| 3161 | asingle expression, but it is just a convention adopted by a lot of |
| 3162 | DTDwriters: |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3163 | <pre><!ATTLIST termdef |
| 3164 | id ID #REQUIRED |
| 3165 | name CDATA #IMPLIED></pre> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3166 | <p>The previous construct defines both |
| 3167 | <code>id</code>and<code>name</code>attributes for the element |
| 3168 | <code>termdef</code>.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3169 | </li> |
| 3170 | </ul> |
| 3171 | |
| 3172 | <h3><a name="Some1">Some examples</a></h3> |
| 3173 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3174 | <p>The directory <code>test/valid/dtds/</code>in the libxml2 |
| 3175 | distributioncontains some complex DTD examples. The example in the |
| 3176 | file<code>test/valid/dia.xml</code>shows an XML file where the simple DTD |
| 3177 | isdirectly included within the document.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3178 | |
| 3179 | <h3><a name="validate1">How to validate</a></h3> |
| 3180 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3181 | <p>The simplest way is to use the xmllint program included with libxml. |
| 3182 | The<code>--valid</code>option turns-on validation of the files given as |
| 3183 | input.For example the following validates a copy of the first revision of the |
| 3184 | XML1.0 specification:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3185 | |
| 3186 | <p><code>xmllint --valid --noout test/valid/REC-xml-19980210.xml</code></p> |
| 3187 | |
Daniel Veillard | 0b28e88 | 2002-07-24 23:47:05 +0000 | [diff] [blame] | 3188 | <p>the -- noout is used to disable output of the resulting tree.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3189 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3190 | <p>The <code>--dtdvalid dtd</code>allows validation of the document(s)against |
| 3191 | a given DTD.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3192 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 3193 | <p>Libxml2 exports an API to handle DTDs and validation, check the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3194 | href="http://xmlsoft.org/html/libxml-valid.html">associateddescription</a>.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3195 | |
| 3196 | <h3><a name="Other1">Other resources</a></h3> |
| 3197 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3198 | <p>DTDs are as old as SGML. So there may be a number of examples on-line, |
| 3199 | Iwill just list one for now, others pointers welcome:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3200 | <ul> |
| 3201 | <li><a href="http://www.xml101.com:8081/dtd/">XML-101 DTD</a></li> |
| 3202 | </ul> |
| 3203 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3204 | <p>I suggest looking at the examples found under test/valid/dtd and any ofthe |
| 3205 | large number of books available on XML. The dia example in test/validshould |
| 3206 | be both simple and complete enough to allow you to build your own.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3207 | |
| 3208 | <p></p> |
| 3209 | |
| 3210 | <h2><a name="Memory">Memory Management</a></h2> |
| 3211 | |
| 3212 | <p>Table of Content:</p> |
| 3213 | <ol> |
| 3214 | <li><a href="#General3">General overview</a></li> |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 3215 | <li><a href="#setting">Setting libxml2 set of memory routines</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3216 | <li><a href="#cleanup">Cleaning up after parsing</a></li> |
| 3217 | <li><a href="#Debugging">Debugging routines</a></li> |
| 3218 | <li><a href="#General4">General memory requirements</a></li> |
| 3219 | </ol> |
| 3220 | |
| 3221 | <h3><a name="General3">General overview</a></h3> |
| 3222 | |
| 3223 | <p>The module <code><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3224 | href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlmemory.h</a></code>provides |
| 3225 | the interfaces to the libxml2 memory system:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3226 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3227 | <li>libxml2 does not use the libc memory allocator directly but |
| 3228 | xmlFree(),xmlMalloc() and xmlRealloc()</li> |
| 3229 | <li>those routines can be reallocated to a specific set of routine, |
| 3230 | bydefault the libc ones i.e. free(), malloc() and realloc()</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3231 | <li>the xmlmemory.c module includes a set of debugging routine</li> |
| 3232 | </ul> |
| 3233 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 3234 | <h3><a name="setting">Setting libxml2 set of memory routines</a></h3> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3235 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3236 | <p>It is sometimes useful to not use the default memory allocator, either |
| 3237 | fordebugging, analysis or to implement a specific behaviour on memory |
| 3238 | management(like on embedded systems). Two function calls are available to do |
| 3239 | so:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3240 | <ul> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3241 | <li><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3242 | href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemGet()</a>which |
| 3243 | return the current set of functions in use by the parser</li> |
| 3244 | <li><a |
| 3245 | href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemSetup()</a>which |
| 3246 | allow to set up a new set of memory allocation functions</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3247 | </ul> |
| 3248 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3249 | <p>Of course a call to xmlMemSetup() should probably be done before |
| 3250 | callingany other libxml2 routines (unless you are sure your allocations |
| 3251 | routines arecompatibles).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3252 | |
| 3253 | <h3><a name="cleanup">Cleaning up after parsing</a></h3> |
| 3254 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3255 | <p>Libxml2 is not stateless, there is a few set of memory structures |
| 3256 | needingallocation before the parser is fully functional (some encoding |
| 3257 | structuresfor example). This also mean that once parsing is finished there is |
| 3258 | a tinyamount of memory (a few hundred bytes) which can be recollected if you |
| 3259 | don'treuse the parser immediately:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3260 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3261 | <li><a |
| 3262 | href="http://xmlsoft.org/html/libxml-parser.html">xmlCleanupParser()</a>is |
| 3263 | a centralized routine to free the parsing states. Note that itwon't |
| 3264 | deallocate any produced tree if any (use the xmlFreeDoc() andrelated |
| 3265 | routines for this).</li> |
| 3266 | <li><a |
| 3267 | href="http://xmlsoft.org/html/libxml-parser.html">xmlInitParser()</a>is |
| 3268 | the dual routine allowing to preallocate the parsing statewhich can be |
| 3269 | useful for example to avoid initialization reentrancyproblems when using |
| 3270 | libxml2 in multithreaded applications</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3271 | </ul> |
| 3272 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3273 | <p>Generally xmlCleanupParser() is safe, if needed the state will be |
| 3274 | rebuildat the next invocation of parser routines, but be careful of the |
| 3275 | consequencesin multithreaded applications.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3276 | |
| 3277 | <h3><a name="Debugging">Debugging routines</a></h3> |
| 3278 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3279 | <p>When configured using --with-mem-debug flag (off by default), libxml2 |
| 3280 | usesa set of memory allocation debugging routines keeping track of all |
| 3281 | allocatedblocks and the location in the code where the routine was called. A |
| 3282 | couple ofother debugging routines allow to dump the memory allocated infos to |
| 3283 | a fileor call a specific routine when a given block number is allocated:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3284 | <ul> |
| 3285 | <li><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3286 | href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMallocLoc()</a><a |
| 3287 | href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlReallocLoc()</a>and |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 3288 | <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3289 | href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemStrdupLoc()</a>are |
| 3290 | the memory debugging replacement allocation routines</li> |
| 3291 | <li><a |
| 3292 | href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemoryDump()</a>dumps |
| 3293 | all the informations about the allocated memory block leftsin the |
| 3294 | <code>.memdump</code>file</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3295 | </ul> |
| 3296 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3297 | <p>When developing libxml2 memory debug is enabled, the tests programs |
| 3298 | callxmlMemoryDump () and the "make test" regression tests will check for |
| 3299 | anymemory leak during the full regression test sequence, this helps a |
| 3300 | lotensuring that libxml2 does not leak memory and bullet proof |
| 3301 | memoryallocations use (some libc implementations are known to be far too |
| 3302 | permissiveresulting in major portability problems!).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3303 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3304 | <p>If the .memdump reports a leak, it displays the allocation function |
| 3305 | andalso tries to give some informations about the content and structure of |
| 3306 | theallocated blocks left. This is sufficient in most cases to find the |
| 3307 | culprit,but not always. Assuming the allocation problem is reproducible, it |
| 3308 | ispossible to find more easily:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3309 | <ol> |
| 3310 | <li>write down the block number xxxx not allocated</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3311 | <li>export the environment variable XML_MEM_BREAKPOINT=xxxx , the |
| 3312 | easiestwhen using GDB is to simply give the command |
Daniel Veillard | 7579482 | 2002-04-11 16:24:32 +0000 | [diff] [blame] | 3313 | <p><code>set environment XML_MEM_BREAKPOINT xxxx</code></p> |
| 3314 | <p>before running the program.</p> |
| 3315 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3316 | <li>run the program under a debugger and set a breakpoint |
| 3317 | onxmlMallocBreakpoint() a specific function called when this precise |
| 3318 | blockis allocated</li> |
| 3319 | <li>when the breakpoint is reached you can then do a fine analysis of |
| 3320 | theallocation an step to see the condition resulting in the |
| 3321 | missingdeallocation.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3322 | </ol> |
| 3323 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3324 | <p>I used to use a commercial tool to debug libxml2 memory problems but |
| 3325 | afternoticing that it was not detecting memory leaks that simple mechanism |
| 3326 | wasused and proved extremely efficient until now. Lately I have also used <a |
| 3327 | href="http://developer.kde.org/~sewardj/">valgrind</a>with quite somesuccess, |
| 3328 | it is tied to the i386 architecture since it works by emulating theprocessor |
| 3329 | and instruction set, it is slow but extremely efficient, i.e. itspot memory |
| 3330 | usage errors in a very precise way.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3331 | |
| 3332 | <h3><a name="General4">General memory requirements</a></h3> |
| 3333 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3334 | <p>How much libxml2 memory require ? It's hard to tell in average it |
| 3335 | dependsof a number of things:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3336 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3337 | <li>the parser itself should work in a fixed amount of memory, except |
| 3338 | forinformation maintained about the stacks of names and entities |
| 3339 | locations.The I/O and encoding handlers will probably account for a few |
| 3340 | KBytes.This is true for both the XML and HTML parser (though the HTML |
| 3341 | parserneed more state).</li> |
| 3342 | <li>If you are generating the DOM tree then memory requirements will |
| 3343 | grownearly linear with the size of the data. In general for a |
| 3344 | balancedtextual document the internal memory requirement is about 4 times |
| 3345 | thesize of the UTF8 serialization of this document (example the |
| 3346 | XML-1.0recommendation is a bit more of 150KBytes and takes 650KBytes of |
| 3347 | mainmemory when parsed). Validation will add a amount of memory required |
| 3348 | formaintaining the external Dtd state which should be linear with |
| 3349 | thecomplexity of the content model defined by the Dtd</li> |
| 3350 | <li>If you need to work with fixed memory requirements or don't need |
| 3351 | thefull DOM tree then using the <a |
| 3352 | href="xmlreader.html">xmlReaderinterface</a>is probably the best way to |
| 3353 | proceed, it still allows tovalidate or operate on subset of the tree if |
| 3354 | needed.</li> |
| 3355 | <li>If you don't care about the advanced features of libxml2 |
| 3356 | likevalidation, DOM, XPath or XPointer, don't use entities, need to work |
| 3357 | withfixed memory requirements, and try to get the fastest parsing |
| 3358 | possiblethen the SAX interface should be used, but it has known |
| 3359 | restrictions.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3360 | </ul> |
| 3361 | |
| 3362 | <p></p> |
| 3363 | |
| 3364 | <h2><a name="Encodings">Encodings support</a></h2> |
| 3365 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3366 | <p>If you are not really familiar with Internationalization (usual shortcutis |
| 3367 | I18N) , Unicode, characters and glyphs, I suggest you read a <a |
| 3368 | href="http://www.tbray.org/ongoing/When/200x/2003/04/06/Unicode">presentation</a>by |
| 3369 | Tim Bray on Unicode and why you should care about it.</p> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 3370 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3371 | <p>If you don't understand why <b>it does not make sense to have a |
| 3372 | stringwithout knowing what encoding it uses</b>, then as Joel Spolsky said <a |
| 3373 | href="http://www.joelonsoftware.com/articles/Unicode.html">please do notwrite |
| 3374 | another line of code until you finish reading that article.</a>. It isa |
| 3375 | prerequisite to understand this page, and avoid a lot of problems |
| 3376 | withlibxml2, XML or text processing in general.</p> |
Daniel Veillard | e5d68de | 2005-03-10 15:03:40 +0000 | [diff] [blame] | 3377 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3378 | <p>Table of Content:</p> |
| 3379 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3380 | <li><a href="encoding.html#What">What does internationalization supportmean |
| 3381 | ?</a></li> |
| 3382 | <li><a href="encoding.html#internal">The internal encoding, how |
| 3383 | andwhy</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3384 | <li><a href="encoding.html#implemente">How is it implemented ?</a></li> |
| 3385 | <li><a href="encoding.html#Default">Default supported encodings</a></li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3386 | <li><a href="encoding.html#extend">How to extend the |
| 3387 | existingsupport</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3388 | </ol> |
| 3389 | |
| 3390 | <h3><a name="What">What does internationalization support mean ?</a></h3> |
| 3391 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3392 | <p>XML was designed from the start to allow the support of any character |
| 3393 | setby using Unicode. Any conformant XML parser has to support the UTF-8 |
| 3394 | andUTF-16 default encodings which can both express the full unicode ranges. |
| 3395 | UTF8is a variable length encoding whose greatest points are to reuse the |
| 3396 | sameencoding for ASCII and to save space for Western encodings, but it is a |
| 3397 | bitmore complex to handle in practice. UTF-16 use 2 bytes per character |
| 3398 | (andsometimes combines two pairs), it makes implementation easier, but looks |
| 3399 | abit overkill for Western languages encoding. Moreover the XML |
| 3400 | specificationallows the document to be encoded in other encodings at the |
| 3401 | condition thatthey are clearly labeled as such. For example the following is |
| 3402 | a wellformedXML document encoded in ISO-8859-1 and using accentuated letters |
| 3403 | that weFrench like for both markup and content:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3404 | <pre><?xml version="1.0" encoding="ISO-8859-1"?> |
| 3405 | <très>là </très></pre> |
| 3406 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 3407 | <p>Having internationalization support in libxml2 means the following:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3408 | <ul> |
| 3409 | <li>the document is properly parsed</li> |
| 3410 | <li>informations about it's encoding are saved</li> |
| 3411 | <li>it can be modified</li> |
| 3412 | <li>it can be saved in its original encoding</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3413 | <li>it can also be saved in another encoding supported by libxml2 |
| 3414 | (forexample straight UTF8 or even an ASCII form)</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3415 | </ul> |
| 3416 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3417 | <p>Another very important point is that the whole libxml2 API, with |
| 3418 | theexception of a few routines to read with a specific encoding or save to |
| 3419 | aspecific encoding, is completely agnostic about the original encoding of |
| 3420 | thedocument.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3421 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3422 | <p>It should be noted too that the HTML parser embedded in libxml2 now |
| 3423 | obeythe same rules too, the following document will be (as of 2.2.2) handled |
| 3424 | inan internationalized fashion by libxml2 too:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3425 | <pre><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" |
| 3426 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
| 3427 | <html lang="fr"> |
| 3428 | <head> |
| 3429 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| 3430 | </head> |
| 3431 | <body> |
| 3432 | <p>W3C crée des standards pour le Web.</body> |
| 3433 | </html></pre> |
| 3434 | |
| 3435 | <h3><a name="internal">The internal encoding, how and why</a></h3> |
| 3436 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3437 | <p>One of the core decisions was to force all documents to be converted to |
| 3438 | adefault internal encoding, and that encoding to be UTF-8, here are |
| 3439 | therationales for those choices:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3440 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3441 | <li>keeping the native encoding in the internal form would force the |
| 3442 | libxmlusers (or the code associated) to be fully aware of the encoding of |
| 3443 | theoriginal document, for examples when adding a text node to a |
| 3444 | document,the content would have to be provided in the document encoding, |
| 3445 | i.e. theclient code would have to check it before hand, make sure it's |
| 3446 | conformantto the encoding, etc ... Very hard in practice, though in some |
| 3447 | specificcases this may make sense.</li> |
| 3448 | <li>the second decision was which encoding. From the XML spec only UTF8 |
| 3449 | andUTF16 really makes sense as being the two only encodings for which |
| 3450 | thereis mandatory support. UCS-4 (32 bits fixed size encoding) could |
| 3451 | beconsidered an intelligent choice too since it's a direct Unicode |
| 3452 | mappingsupport. I selected UTF-8 on the basis of efficiency and |
| 3453 | compatibilitywith surrounding software: |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3454 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3455 | <li>UTF-8 while a bit more complex to convert from/to (i.e. |
| 3456 | slightlymore costly to import and export CPU wise) is also far more |
| 3457 | compactthan UTF-16 (and UCS-4) for a majority of the documents I see |
| 3458 | it usedfor right now (RPM RDF catalogs, advogato data, various |
| 3459 | configurationfile formats, etc.) and the key point for today's |
| 3460 | computerarchitecture is efficient uses of caches. If one nearly |
| 3461 | double thememory requirement to store the same amount of data, this |
| 3462 | will trashcaches (main memory/external caches/internal caches) and my |
| 3463 | take isthat this harms the system far more than the CPU requirements |
| 3464 | neededfor the conversion to UTF-8</li> |
| 3465 | <li>Most of libxml2 version 1 users were using it with straight |
| 3466 | ASCIImost of the time, doing the conversion with an internal |
| 3467 | encodingrequiring all their code to be rewritten was a serious |
| 3468 | show-stopperfor using UTF-16 or UCS-4.</li> |
| 3469 | <li>UTF-8 is being used as the de-facto internal encoding standard |
| 3470 | forrelated code like the <a |
| 3471 | href="http://www.pango.org/">pango</a>upcoming Gnome text widget, and |
| 3472 | a lot of Unix code (yet another placewhere Unix programmer base takes |
| 3473 | a different approach from Microsoft- they are using UTF-16)</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3474 | </ul> |
| 3475 | </li> |
| 3476 | </ul> |
| 3477 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 3478 | <p>What does this mean in practice for the libxml2 user:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3479 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3480 | <li>xmlChar, the libxml2 data type is a byte, those bytes must be |
| 3481 | assembledas UTF-8 valid strings. The proper way to terminate an xmlChar * |
| 3482 | stringis simply to append 0 byte, as usual.</li> |
| 3483 | <li>One just need to make sure that when using chars outside the ASCII |
| 3484 | set,the values has been properly converted to UTF-8</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3485 | </ul> |
| 3486 | |
| 3487 | <h3><a name="implemente">How is it implemented ?</a></h3> |
| 3488 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3489 | <p>Let's describe how all this works within libxml, basically the |
| 3490 | I18N(internationalization) support get triggered only during I/O operation, |
| 3491 | i.e.when reading a document or saving one. Let's look first at the |
| 3492 | readingsequence:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3493 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3494 | <li>when a document is processed, we usually don't know the encoding, |
| 3495 | asimple heuristic allows to detect UTF-16 and UCS-4 from encodings |
| 3496 | wherethe ASCII range (0-0x7F) maps with ASCII</li> |
| 3497 | <li>the xml declaration if available is parsed, including the |
| 3498 | encodingdeclaration. At that point, if the autodetected encoding is |
| 3499 | differentfrom the one declared a call to xmlSwitchEncoding() is |
| 3500 | issued.</li> |
| 3501 | <li>If there is no encoding declaration, then the input has to be in |
| 3502 | eitherUTF-8 or UTF-16, if it is not then at some point when processing |
| 3503 | theinput, the converter/checker of UTF-8 form will raise an encoding |
| 3504 | error.You may end-up with a garbled document, or no document at all ! |
| 3505 | Example: |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3506 | <pre>~/XML -> ./xmllint err.xml |
| 3507 | err.xml:1: error: Input is not proper UTF-8, indicate encoding ! |
| 3508 | <très>là </très> |
| 3509 | ^ |
| 3510 | err.xml:1: error: Bytes: 0xE8 0x73 0x3E 0x6C |
| 3511 | <très>là </très> |
| 3512 | ^</pre> |
| 3513 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3514 | <li>xmlSwitchEncoding() does an encoding name lookup, canonicalize it, |
| 3515 | andthen search the default registered encoding converters for that |
| 3516 | encoding.If it's not within the default set and iconv() support has been |
| 3517 | compiledit, it will ask iconv for such an encoder. If this fails then the |
| 3518 | parserwill report an error and stops processing: |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3519 | <pre>~/XML -> ./xmllint err2.xml |
| 3520 | err2.xml:1: error: Unsupported encoding UnsupportedEnc |
| 3521 | <?xml version="1.0" encoding="UnsupportedEnc"?> |
| 3522 | ^</pre> |
| 3523 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3524 | <li>From that point the encoder processes progressively the input (it |
| 3525 | isplugged as a front-end to the I/O module) for that entity. It |
| 3526 | capturesand converts on-the-fly the document to be parsed to UTF-8. The |
| 3527 | parseritself just does UTF-8 checking of this input and process |
| 3528 | ittransparently. The only difference is that the encoding information |
| 3529 | hasbeen added to the parsing context (more precisely to the |
| 3530 | inputcorresponding to this entity).</li> |
| 3531 | <li>The result (when using DOM) is an internal form completely in UTF-8with |
| 3532 | just an encoding information on the document node.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3533 | </ol> |
| 3534 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3535 | <p>Ok then what happens when saving the document (assuming youcollected/built |
| 3536 | an xmlDoc DOM like structure) ? It depends on the functioncalled, |
| 3537 | xmlSaveFile() will just try to save in the original encoding, |
| 3538 | whilexmlSaveFileTo() and xmlSaveFileEnc() can optionally save to a |
| 3539 | givenencoding:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3540 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3541 | <li>if no encoding is given, libxml2 will look for an encoding |
| 3542 | valueassociated to the document and if it exists will try to save to |
| 3543 | thatencoding, |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3544 | <p>otherwise everything is written in the internal form, i.e. UTF-8</p> |
| 3545 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3546 | <li>so if an encoding was specified, either at the API level or on |
| 3547 | thedocument, libxml2 will again canonicalize the encoding name, lookup |
| 3548 | for aconverter in the registered set or through iconv. If not found |
| 3549 | thefunction will return an error code</li> |
| 3550 | <li>the converter is placed before the I/O buffer layer, as another kind |
| 3551 | ofbuffer, then libxml2 will simply push the UTF-8 serialization to |
| 3552 | throughthat buffer, which will then progressively be converted and pushed |
| 3553 | ontothe I/O layer.</li> |
| 3554 | <li>It is possible that the converter code fails on some input, for |
| 3555 | exampletrying to push an UTF-8 encoded Chinese character through the |
| 3556 | UTF-8 toISO-8859-1 converter won't work. Since the encoders are |
| 3557 | progressive theywill just report the error and the number of bytes |
| 3558 | converted, at thatpoint libxml2 will decode the offending character, |
| 3559 | remove it from thebuffer and replace it with the associated charRef |
| 3560 | encoding &#123; andresume the conversion. This guarantees that any |
| 3561 | document will be savedwithout losses (except for markup names where this |
| 3562 | is not legal, this isa problem in the current version, in practice avoid |
| 3563 | using non-asciicharacters for tag or attribute names). A special "ascii" |
| 3564 | encoding nameis used to save documents to a pure ascii form can be used |
| 3565 | whenportability is really crucial</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3566 | </ol> |
| 3567 | |
Daniel Veillard | abfca61 | 2004-01-07 23:38:02 +0000 | [diff] [blame] | 3568 | <p>Here are a few examples based on the same test document:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3569 | <pre>~/XML -> ./xmllint isolat1 |
| 3570 | <?xml version="1.0" encoding="ISO-8859-1"?> |
| 3571 | <très>là </très> |
| 3572 | ~/XML -> ./xmllint --encode UTF-8 isolat1 |
| 3573 | <?xml version="1.0" encoding="UTF-8"?> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3574 | <très>là  </très> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3575 | ~/XML -> </pre> |
| 3576 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3577 | <p>The same processing is applied (and reuse most of the code) for HTML |
| 3578 | I18Nprocessing. Looking up and modifying the content encoding is a bit |
| 3579 | moredifficult since it is located in a <meta> tag under the |
| 3580 | <head>,so a couple of functions htmlGetMetaEncoding() and |
| 3581 | htmlSetMetaEncoding() havebeen provided. The parser also attempts to switch |
| 3582 | encoding on the fly whendetecting such a tag on input. Except for that the |
| 3583 | processing is the same(and again reuses the same code).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3584 | |
| 3585 | <h3><a name="Default">Default supported encodings</a></h3> |
| 3586 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3587 | <p>libxml2 has a set of default converters for the following |
| 3588 | encodings(located in encoding.c):</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3589 | <ol> |
| 3590 | <li>UTF-8 is supported by default (null handlers)</li> |
| 3591 | <li>UTF-16, both little and big endian</li> |
| 3592 | <li>ISO-Latin-1 (ISO-8859-1) covering most western languages</li> |
| 3593 | <li>ASCII, useful mostly for saving</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3594 | <li>HTML, a specific handler for the conversion of UTF-8 to ASCII with |
| 3595 | HTMLpredefined entities like &copy; for the Copyright sign.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3596 | </ol> |
| 3597 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3598 | <p>More over when compiled on an Unix platform with iconv support the fullset |
| 3599 | of encodings supported by iconv can be instantly be used by libxml. On alinux |
| 3600 | machine with glibc-2.1 the list of supported encodings and aliases fill3 full |
| 3601 | pages, and include UCS-4, the full set of ISO-Latin encodings, and thevarious |
| 3602 | Japanese ones.</p> |
Daniel Veillard | 6795260 | 2006-01-05 15:29:44 +0000 | [diff] [blame] | 3603 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3604 | <p>To convert from the UTF-8 values returned from the API to another |
| 3605 | encodingthen it is possible to use the function provided from <a |
| 3606 | href="html/libxml-encoding.html">the encoding module</a>like <a |
| 3607 | href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a>, or use |
| 3608 | thePOSIX <a |
| 3609 | href="http://www.opengroup.org/onlinepubs/009695399/functions/iconv.html">iconv()</a>API |
| 3610 | directly.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3611 | |
| 3612 | <h4>Encoding aliases</h4> |
| 3613 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3614 | <p>From 2.2.3, libxml2 has support to register encoding names aliases. |
| 3615 | Thegoal is to be able to parse document whose encoding is supported but |
| 3616 | wherethe name differs (for example from the default set of names accepted |
| 3617 | byiconv). The following functions allow to register and handle new aliases |
| 3618 | forexisting encodings. Once registered libxml2 will automatically lookup |
| 3619 | thealiases when handling a document:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3620 | <ul> |
| 3621 | <li>int xmlAddEncodingAlias(const char *name, const char *alias);</li> |
| 3622 | <li>int xmlDelEncodingAlias(const char *alias);</li> |
| 3623 | <li>const char * xmlGetEncodingAlias(const char *alias);</li> |
| 3624 | <li>void xmlCleanupEncodingAliases(void);</li> |
| 3625 | </ul> |
| 3626 | |
| 3627 | <h3><a name="extend">How to extend the existing support</a></h3> |
| 3628 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3629 | <p>Well adding support for new encoding, or overriding one of the |
| 3630 | encoders(assuming it is buggy) should not be hard, just write input and |
| 3631 | outputconversion routines to/from UTF-8, and register them |
| 3632 | usingxmlNewCharEncodingHandler(name, xxxToUTF8, UTF8Toxxx), and they will |
| 3633 | becalled automatically if the parser(s) encounter such an encoding |
| 3634 | name(register it uppercase, this will help). The description of the |
| 3635 | encoders,their arguments and expected return values are described in the |
| 3636 | encoding.hheader.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3637 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3638 | <h2><a name="IO">I/O Interfaces</a></h2> |
| 3639 | |
| 3640 | <p>Table of Content:</p> |
| 3641 | <ol> |
| 3642 | <li><a href="#General1">General overview</a></li> |
| 3643 | <li><a href="#basic">The basic buffer type</a></li> |
| 3644 | <li><a href="#Input">Input I/O handlers</a></li> |
| 3645 | <li><a href="#Output">Output I/O handlers</a></li> |
| 3646 | <li><a href="#entities">The entities loader</a></li> |
| 3647 | <li><a href="#Example2">Example of customized I/O</a></li> |
| 3648 | </ol> |
| 3649 | |
| 3650 | <h3><a name="General1">General overview</a></h3> |
| 3651 | |
| 3652 | <p>The module <code><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3653 | href="http://xmlsoft.org/html/libxml-xmlio.html">xmlIO.h</a></code>providesthe |
| 3654 | interfaces to the libxml2 I/O system. This consists of 4 main parts:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3655 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3656 | <li>Entities loader, this is a routine which tries to fetch the |
| 3657 | entities(files) based on their PUBLIC and SYSTEM identifiers. The default |
| 3658 | loaderdon't look at the public identifier since libxml2 do not maintain |
| 3659 | acatalog. You can redefine you own entity loader by |
| 3660 | using<code>xmlGetExternalEntityLoader()</code>and<code>xmlSetExternalEntityLoader()</code>. |
| 3661 | <a href="#entities">Check theexample</a>.</li> |
| 3662 | <li>Input I/O buffers which are a commodity structure used by the |
| 3663 | parser(s)input layer to handle fetching the informations to feed the |
| 3664 | parser. Thisprovides buffering and is also a placeholder where the |
| 3665 | encodingconverters to UTF8 are piggy-backed.</li> |
| 3666 | <li>Output I/O buffers are similar to the Input ones and fulfill |
| 3667 | similartask but when generating a serialization from a tree.</li> |
| 3668 | <li>A mechanism to register sets of I/O callbacks and associate them |
| 3669 | withspecific naming schemes like the protocol part of the URIs. |
| 3670 | <p>This affect the default I/O operations and allows to use specific |
| 3671 | I/Ohandlers for certain names.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3672 | </li> |
| 3673 | </ul> |
| 3674 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3675 | <p>The general mechanism used when loading http://rpmfind.net/xml.html |
| 3676 | forexample in the HTML parser is the following:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3677 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3678 | <li>The default entity loader calls |
| 3679 | <code>xmlNewInputFromFile()</code>withthe parsing context and the URI |
| 3680 | string.</li> |
| 3681 | <li>the URI string is checked against the existing registered handlersusing |
| 3682 | their match() callback function, if the HTTP module was compiledin, it is |
| 3683 | registered and its match() function will succeeds</li> |
| 3684 | <li>the open() function of the handler is called and if successful |
| 3685 | willreturn an I/O Input buffer</li> |
| 3686 | <li>the parser will the start reading from this buffer and |
| 3687 | progressivelyfetch information from the resource, calling the read() |
| 3688 | function of thehandler until the resource is exhausted</li> |
| 3689 | <li>if an encoding change is detected it will be installed on the |
| 3690 | inputbuffer, providing buffering and efficient use of the |
| 3691 | conversionroutines</li> |
| 3692 | <li>once the parser has finished, the close() function of the handler |
| 3693 | iscalled once and the Input buffer and associated resources |
| 3694 | aredeallocated.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3695 | </ol> |
| 3696 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3697 | <p>The user defined callbacks are checked first to allow overriding of |
| 3698 | thedefault libxml2 I/O routines.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3699 | |
| 3700 | <h3><a name="basic">The basic buffer type</a></h3> |
| 3701 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3702 | <p>All the buffer manipulation handling is done using |
| 3703 | the<code>xmlBuffer</code>type define in <code><a |
| 3704 | href="http://xmlsoft.org/html/libxml-tree.html">tree.h</a></code>which is |
| 3705 | aresizable memory buffer. The buffer allocation strategy can be selected to |
| 3706 | beeither best-fit or use an exponential doubling one (CPU vs. memory |
| 3707 | usetrade-off). The values are |
| 3708 | <code>XML_BUFFER_ALLOC_EXACT</code>and<code>XML_BUFFER_ALLOC_DOUBLEIT</code>, |
| 3709 | and can be set individually or on asystem wide basis using |
| 3710 | <code>xmlBufferSetAllocationScheme()</code>. A numberof functions allows to |
| 3711 | manipulate buffers with names starting with |
| 3712 | the<code>xmlBuffer...</code>prefix.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3713 | |
| 3714 | <h3><a name="Input">Input I/O handlers</a></h3> |
| 3715 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3716 | <p>An Input I/O handler is a simple |
| 3717 | structure<code>xmlParserInputBuffer</code>containing a context associated to |
| 3718 | theresource (file descriptor, or pointer to a protocol handler), the read() |
| 3719 | andclose() callbacks to use and an xmlBuffer. And extra xmlBuffer and a |
| 3720 | charsetencoding handler are also present to support charset conversion |
| 3721 | whenneeded.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3722 | |
| 3723 | <h3><a name="Output">Output I/O handlers</a></h3> |
| 3724 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3725 | <p>An Output handler <code>xmlOutputBuffer</code>is completely similar to |
| 3726 | anInput one except the callbacks are write() and close().</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3727 | |
| 3728 | <h3><a name="entities">The entities loader</a></h3> |
| 3729 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3730 | <p>The entity loader resolves requests for new entities and create inputs |
| 3731 | forthe parser. Creating an input from a filename or an URI string is |
| 3732 | donethrough the xmlNewInputFromFile() routine. The default entity loader do |
| 3733 | nothandle the PUBLIC identifier associated with an entity (if any). So it |
| 3734 | justcalls xmlNewInputFromFile() with the SYSTEM identifier (which is |
| 3735 | mandatory inXML).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3736 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3737 | <p>If you want to hook up a catalog mechanism then you simply need tooverride |
| 3738 | the default entity loader, here is an example:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3739 | <pre>#include <libxml/xmlIO.h> |
| 3740 | |
| 3741 | xmlExternalEntityLoader defaultLoader = NULL; |
| 3742 | |
| 3743 | xmlParserInputPtr |
| 3744 | xmlMyExternalEntityLoader(const char *URL, const char *ID, |
| 3745 | xmlParserCtxtPtr ctxt) { |
| 3746 | xmlParserInputPtr ret; |
| 3747 | const char *fileID = NULL; |
| 3748 | /* lookup for the fileID depending on ID */ |
| 3749 | |
| 3750 | ret = xmlNewInputFromFile(ctxt, fileID); |
| 3751 | if (ret != NULL) |
| 3752 | return(ret); |
| 3753 | if (defaultLoader != NULL) |
| 3754 | ret = defaultLoader(URL, ID, ctxt); |
| 3755 | return(ret); |
| 3756 | } |
| 3757 | |
| 3758 | int main(..) { |
| 3759 | ... |
| 3760 | |
| 3761 | /* |
| 3762 | * Install our own entity loader |
| 3763 | */ |
| 3764 | defaultLoader = xmlGetExternalEntityLoader(); |
| 3765 | xmlSetExternalEntityLoader(xmlMyExternalEntityLoader); |
| 3766 | |
| 3767 | ... |
| 3768 | }</pre> |
| 3769 | |
| 3770 | <h3><a name="Example2">Example of customized I/O</a></h3> |
| 3771 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3772 | <p>This example come from <a |
| 3773 | href="http://xmlsoft.org/messages/0708.html">areal use case</a>, |
| 3774 | xmlDocDump() closes the FILE * passed by the applicationand this was a |
| 3775 | problem. The <a href="http://xmlsoft.org/messages/0711.html">solution</a>was |
| 3776 | to redefine anew output handler with the closing call deactivated:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3777 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3778 | <li>First define a new I/O output allocator where the output don't closethe |
| 3779 | file: |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3780 | <pre>xmlOutputBufferPtr |
| 3781 | xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) { |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3782 | Â Â Â Â xmlOutputBufferPtr ret; |
| 3783 | Â Â Â Â |
| 3784 | Â Â Â Â if (xmlOutputCallbackInitialized == 0) |
| 3785 | Â Â Â Â Â Â Â Â xmlRegisterDefaultOutputCallbacks(); |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3786 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3787 | Â Â Â Â if (file == NULL) return(NULL); |
| 3788 | Â Â Â Â ret = xmlAllocOutputBuffer(encoder); |
| 3789 | Â Â Â Â if (ret != NULL) { |
| 3790 | Â Â Â Â Â Â Â Â ret->context = file; |
| 3791 | Â Â Â Â Â Â Â Â ret->writecallback = xmlFileWrite; |
| 3792 | Â Â Â Â Â Â Â Â ret->closecallback = NULL; /* No close callback */ |
| 3793 | Â Â Â Â } |
| 3794 | Â Â Â Â return(ret); |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3795 | } </pre> |
| 3796 | </li> |
| 3797 | <li>And then use it to save the document: |
| 3798 | <pre>FILE *f; |
| 3799 | xmlOutputBufferPtr output; |
| 3800 | xmlDocPtr doc; |
| 3801 | int res; |
| 3802 | |
| 3803 | f = ... |
| 3804 | doc = .... |
| 3805 | |
| 3806 | output = xmlOutputBufferCreateOwn(f, NULL); |
| 3807 | res = xmlSaveFileTo(output, doc, NULL); |
| 3808 | </pre> |
| 3809 | </li> |
| 3810 | </ol> |
| 3811 | |
| 3812 | <h2><a name="Catalog">Catalog support</a></h2> |
| 3813 | |
| 3814 | <p>Table of Content:</p> |
| 3815 | <ol> |
| 3816 | <li><a href="General2">General overview</a></li> |
| 3817 | <li><a href="#definition">The definition</a></li> |
| 3818 | <li><a href="#Simple">Using catalogs</a></li> |
| 3819 | <li><a href="#Some">Some examples</a></li> |
| 3820 | <li><a href="#reference">How to tune catalog usage</a></li> |
| 3821 | <li><a href="#validate">How to debug catalog processing</a></li> |
| 3822 | <li><a href="#Declaring">How to create and maintain catalogs</a></li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3823 | <li><a href="#implemento">The implementor corner quick review of |
| 3824 | theAPI</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3825 | <li><a href="#Other">Other resources</a></li> |
| 3826 | </ol> |
| 3827 | |
| 3828 | <h3><a name="General2">General overview</a></h3> |
| 3829 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3830 | <p>What is a catalog? Basically it's a lookup mechanism used when an entity(a |
| 3831 | file or a remote resource) references another entity. The catalog lookupis |
| 3832 | inserted between the moment the reference is recognized by the software(XML |
| 3833 | parser, stylesheet processing, or even images referenced for inclusionin a |
| 3834 | rendering) and the time where loading that resource is actuallystarted.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3835 | |
| 3836 | <p>It is basically used for 3 things:</p> |
| 3837 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3838 | <li>mapping from "logical" names, the public identifiers and a moreconcrete |
| 3839 | name usable for download (and URI). For example it can associatethe |
| 3840 | logical name |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3841 | <p>"-//OASIS//DTD DocBook XML V4.1.2//EN"</p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3842 | <p>of the DocBook 4.1.2 XML DTD with the actual URL where it can |
| 3843 | bedownloaded</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3844 | <p>http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd</p> |
| 3845 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3846 | <li>remapping from a given URL to another one, like an HTTP |
| 3847 | indirectionsaying that |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3848 | <p>"http://www.oasis-open.org/committes/tr.xsl"</p> |
| 3849 | <p>should really be looked at</p> |
| 3850 | <p>"http://www.oasis-open.org/committes/entity/stylesheets/base/tr.xsl"</p> |
| 3851 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3852 | <li>providing a local cache mechanism allowing to load the |
| 3853 | entitiesassociated to public identifiers or remote resources, this is a |
| 3854 | reallyimportant feature for any significant deployment of XML or SGML |
| 3855 | since itallows to avoid the aleas and delays associated to fetching |
| 3856 | remoteresources.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3857 | </ul> |
| 3858 | |
| 3859 | <h3><a name="definition">The definitions</a></h3> |
| 3860 | |
| 3861 | <p>Libxml, as of 2.4.3 implements 2 kind of catalogs:</p> |
| 3862 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3863 | <li>the older SGML catalogs, the official spec is SGML Open |
| 3864 | TechnicalResolution TR9401:1997, but is better understood by reading <a |
| 3865 | href="http://www.jclark.com/sp/catalog.htm">the SP Catalog |
| 3866 | page</a>fromJames Clark. This is relatively old and not the preferred |
| 3867 | mode ofoperation of libxml.</li> |
| 3868 | <li><a |
| 3869 | href="http://www.oasis-open.org/committees/entity/spec.html">XMLCatalogs</a>is |
| 3870 | far more flexible, more recent, uses an XML syntax andshould scale quite |
| 3871 | better. This is the default option of libxml.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3872 | </ul> |
| 3873 | |
| 3874 | <p></p> |
| 3875 | |
| 3876 | <h3><a name="Simple">Using catalog</a></h3> |
| 3877 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3878 | <p>In a normal environment libxml2 will by default check the presence of |
| 3879 | acatalog in /etc/xml/catalog, and assuming it has been correctly |
| 3880 | populated,the processing is completely transparent to the document user. To |
| 3881 | take aconcrete example, suppose you are authoring a DocBook document, this |
| 3882 | onestarts with the following DOCTYPE definition:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3883 | <pre><?xml version='1.0'?> |
| 3884 | <!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4//EN" |
| 3885 | "http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd"></pre> |
| 3886 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3887 | <p>When validating the document with libxml, the catalog will beautomatically |
| 3888 | consulted to lookup the public identifier "-//Norman Walsh//DTDDocBk XML |
| 3889 | V3.1.4//EN" and the system |
| 3890 | identifier"http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd", and if these |
| 3891 | entities havebeen installed on your system and the catalogs actually point to |
| 3892 | them, libxmlwill fetch them from the local disk.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3893 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3894 | <p style="font-size: 10pt"><strong>Note</strong>: Really don't use |
| 3895 | thisDOCTYPE example it's a really old version, but is fine as an example.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3896 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3897 | <p>Libxml2 will check the catalog each time that it is requested to load |
| 3898 | anentity, this includes DTD, external parsed entities, stylesheets, etc ... |
| 3899 | Ifyour system is correctly configured all the authoring phase and |
| 3900 | processingshould use only local files, even if your document stays portable |
| 3901 | because ituses the canonical public and system ID, referencing the remote |
| 3902 | document.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3903 | |
| 3904 | <h3><a name="Some">Some examples:</a></h3> |
| 3905 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3906 | <p>Here is a couple of fragments from XML Catalogs used in libxml2 |
| 3907 | earlyregression tests in <code>test/catalogs</code>:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3908 | <pre><?xml version="1.0"?> |
| 3909 | <!DOCTYPE catalog PUBLIC |
| 3910 | "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" |
| 3911 | "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> |
| 3912 | <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> |
| 3913 | <public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 3914 | uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/> |
| 3915 | ...</pre> |
| 3916 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3917 | <p>This is the beginning of a catalog for DocBook 4.1.2, XML Catalogs |
| 3918 | arewritten in XML, there is a specific namespace for catalog |
| 3919 | elements"urn:oasis:names:tc:entity:xmlns:xml:catalog". The first entry in |
| 3920 | thiscatalog is a <code>public</code>mapping it allows to associate a |
| 3921 | PublicIdentifier with an URI.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3922 | <pre>... |
| 3923 | <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/" |
| 3924 | rewritePrefix="file:///usr/share/xml/docbook/"/> |
| 3925 | ...</pre> |
| 3926 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3927 | <p>A <code>rewriteSystem</code>is a very powerful instruction, it says |
| 3928 | thatany URI starting with a given prefix should be looked at another |
| 3929 | URIconstructed by replacing the prefix with an new one. In effect this acts |
| 3930 | likea cache system for a full area of the Web. In practice it is extremely |
| 3931 | usefulwith a file prefix if you have installed a copy of those resources on |
| 3932 | yourlocal system.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3933 | <pre>... |
| 3934 | <delegatePublic publicIdStartString="-//OASIS//DTD XML Catalog //" |
| 3935 | catalog="file:///usr/share/xml/docbook.xml"/> |
| 3936 | <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook XML" |
| 3937 | catalog="file:///usr/share/xml/docbook.xml"/> |
| 3938 | <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML" |
| 3939 | catalog="file:///usr/share/xml/docbook.xml"/> |
| 3940 | <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/" |
| 3941 | catalog="file:///usr/share/xml/docbook.xml"/> |
| 3942 | <delegateURI uriStartString="http://www.oasis-open.org/docbook/" |
| 3943 | catalog="file:///usr/share/xml/docbook.xml"/> |
| 3944 | ...</pre> |
| 3945 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3946 | <p>Delegation is the core features which allows to build a tree of |
| 3947 | catalogs,easier to maintain than a single catalog, based on Public |
| 3948 | Identifier, SystemIdentifier or URI prefixes it instructs the catalog |
| 3949 | software to look upentries in another resource. This feature allow to build |
| 3950 | hierarchies ofcatalogs, the set of entries presented should be sufficient to |
| 3951 | redirect theresolution of all DocBook references to the specific catalog |
| 3952 | in<code>/usr/share/xml/docbook.xml</code>this one in turn could delegate |
| 3953 | allreferences for DocBook 4.2.1 to a specific catalog installed at the same |
| 3954 | timeas the DocBook resources on the local machine.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3955 | |
| 3956 | <h3><a name="reference">How to tune catalog usage:</a></h3> |
| 3957 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3958 | <p>The user can change the default catalog behaviour by redirecting queriesto |
| 3959 | its own set of catalogs, this can be done by setting |
| 3960 | the<code>XML_CATALOG_FILES</code>environment variable to a list of catalogs, |
| 3961 | anempty one should deactivate loading the default |
| 3962 | <code>/etc/xml/catalog</code>default catalog</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3963 | |
| 3964 | <h3><a name="validate">How to debug catalog processing:</a></h3> |
| 3965 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3966 | <p>Setting up the <code>XML_DEBUG_CATALOG</code>environment variable willmake |
| 3967 | libxml2 output debugging informations for each catalog operations, |
| 3968 | forexample:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3969 | <pre>orchis:~/XML -> xmllint --memory --noout test/ent2 |
| 3970 | warning: failed to load external entity "title.xml" |
| 3971 | orchis:~/XML -> export XML_DEBUG_CATALOG= |
| 3972 | orchis:~/XML -> xmllint --memory --noout test/ent2 |
| 3973 | Failed to parse catalog /etc/xml/catalog |
| 3974 | Failed to parse catalog /etc/xml/catalog |
| 3975 | warning: failed to load external entity "title.xml" |
| 3976 | Catalogs cleanup |
| 3977 | orchis:~/XML -> </pre> |
| 3978 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3979 | <p>The test/ent2 references an entity, running the parser from memory |
| 3980 | makesthe base URI unavailable and the the "title.xml" entity cannot be |
| 3981 | loaded.Setting up the debug environment variable allows to detect that an |
| 3982 | attempt ismade to load the <code>/etc/xml/catalog</code>but since it's not |
| 3983 | present theresolution fails.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3984 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3985 | <p>But the most advanced way to debug XML catalog processing is to use |
| 3986 | the<strong>xmlcatalog</strong>command shipped with libxml2, it allows to |
| 3987 | loadcatalogs and make resolution queries to see what is going on. This is |
| 3988 | alsoused for the regression tests:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3989 | <pre>orchis:~/XML -> ./xmlcatalog test/catalogs/docbook.xml \ |
| 3990 | "-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 3991 | http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd |
| 3992 | orchis:~/XML -> </pre> |
| 3993 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 3994 | <p>For debugging what is going on, adding one -v flags increase the |
| 3995 | verbositylevel to indicate the processing done (adding a second flag also |
| 3996 | indicatewhat elements are recognized at parsing):</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 3997 | <pre>orchis:~/XML -> ./xmlcatalog -v test/catalogs/docbook.xml \ |
| 3998 | "-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 3999 | Parsing catalog test/catalogs/docbook.xml's content |
| 4000 | Found public match -//OASIS//DTD DocBook XML V4.1.2//EN |
| 4001 | http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd |
| 4002 | Catalogs cleanup |
| 4003 | orchis:~/XML -> </pre> |
| 4004 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4005 | <p>A shell interface is also available to debug and process multiple |
| 4006 | queries(and for regression tests):</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4007 | <pre>orchis:~/XML -> ./xmlcatalog -shell test/catalogs/docbook.xml \ |
| 4008 | "-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 4009 | > help |
| 4010 | Commands available: |
| 4011 | public PublicID: make a PUBLIC identifier lookup |
| 4012 | system SystemID: make a SYSTEM identifier lookup |
| 4013 | resolve PublicID SystemID: do a full resolver lookup |
| 4014 | add 'type' 'orig' 'replace' : add an entry |
| 4015 | del 'values' : remove values |
| 4016 | dump: print the current catalog state |
| 4017 | debug: increase the verbosity level |
| 4018 | quiet: decrease the verbosity level |
| 4019 | exit: quit the shell |
| 4020 | > public "-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 4021 | http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd |
| 4022 | > quit |
| 4023 | orchis:~/XML -> </pre> |
| 4024 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4025 | <p>This should be sufficient for most debugging purpose, this was |
| 4026 | actuallyused heavily to debug the XML Catalog implementation itself.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4027 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4028 | <h3><a name="Declaring">How to create and maintain</a>catalogs:</h3> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4029 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4030 | <p>Basically XML Catalogs are XML files, you can either use XML tools |
| 4031 | tomanage them or use <strong>xmlcatalog</strong>for this. The basic step |
| 4032 | isto create a catalog the -create option provide this facility:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4033 | <pre>orchis:~/XML -> ./xmlcatalog --create tst.xml |
| 4034 | <?xml version="1.0"?> |
| 4035 | <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" |
| 4036 | "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> |
| 4037 | <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/> |
| 4038 | orchis:~/XML -> </pre> |
| 4039 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4040 | <p>By default xmlcatalog does not overwrite the original catalog and save |
| 4041 | theresult on the standard output, this can be overridden using the |
| 4042 | -nooutoption. The <code>-add</code>command allows to add entries in |
| 4043 | thecatalog:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4044 | <pre>orchis:~/XML -> ./xmlcatalog --noout --create --add "public" \ |
| 4045 | "-//OASIS//DTD DocBook XML V4.1.2//EN" \ |
| 4046 | http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd tst.xml |
| 4047 | orchis:~/XML -> cat tst.xml |
| 4048 | <?xml version="1.0"?> |
| 4049 | <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" \ |
| 4050 | "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> |
| 4051 | <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> |
| 4052 | <public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN" |
| 4053 | uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/> |
| 4054 | </catalog> |
| 4055 | orchis:~/XML -> </pre> |
| 4056 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4057 | <p>The <code>-add</code>option will always take 3 parameters even if some |
| 4058 | ofthe XML Catalog constructs (like nextCatalog) will have only a |
| 4059 | singleargument, just pass a third empty string, it will be ignored.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4060 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4061 | <p>Similarly the <code>-del</code>option remove matching entries from |
| 4062 | thecatalog:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4063 | <pre>orchis:~/XML -> ./xmlcatalog --del \ |
| 4064 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" tst.xml |
| 4065 | <?xml version="1.0"?> |
| 4066 | <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" |
| 4067 | "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> |
| 4068 | <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/> |
| 4069 | orchis:~/XML -> </pre> |
| 4070 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4071 | <p>The catalog is now empty. Note that the matching of |
| 4072 | <code>-del</code>isexact and would have worked in a similar fashion with the |
| 4073 | Public IDstring.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4074 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4075 | <p>This is rudimentary but should be sufficient to manage a not too |
| 4076 | complexcatalog tree of resources.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4077 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4078 | <h3><a name="implemento">The implementor corner quick review of |
| 4079 | theAPI:</a></h3> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4080 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4081 | <p>First, and like for every other module of libxml, there is anautomatically |
| 4082 | generated <a href="html/libxml-catalog.html">API page forcatalog |
| 4083 | support</a>.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4084 | |
| 4085 | <p>The header for the catalog interfaces should be included as:</p> |
| 4086 | <pre>#include <libxml/catalog.h></pre> |
| 4087 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4088 | <p>The API is voluntarily kept very simple. First it is not obvious |
| 4089 | thatapplications really need access to it since it is the default behaviour |
| 4090 | oflibxml2 (Note: it is possible to completely override libxml2 default |
| 4091 | catalogby using <a |
| 4092 | href="html/libxml-parser.html">xmlSetExternalEntityLoader</a>toplug an |
| 4093 | application specific resolver).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4094 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 4095 | <p>Basically libxml2 support 2 catalog lists:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4096 | <ul> |
| 4097 | <li>the default one, global shared by all the application</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4098 | <li>a per-document catalog, this one is built if the document uses |
| 4099 | the<code>oasis-xml-catalog</code>PIs to specify its own catalog list, it |
| 4100 | isassociated to the parser context and destroyed when the parsing |
| 4101 | contextis destroyed.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4102 | </ul> |
| 4103 | |
| 4104 | <p>the document one will be used first if it exists.</p> |
| 4105 | |
| 4106 | <h4>Initialization routines:</h4> |
| 4107 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4108 | <p>xmlInitializeCatalog(), xmlLoadCatalog() and xmlLoadCatalogs() should |
| 4109 | beused at startup to initialize the catalog, if the catalog should |
| 4110 | beinitialized with specific values xmlLoadCatalog() or |
| 4111 | xmlLoadCatalogs()should be called before xmlInitializeCatalog() which would |
| 4112 | otherwise do adefault initialization first.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4113 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4114 | <p>The xmlCatalogAddLocal() call is used by the parser to grow the |
| 4115 | documentown catalog list if needed.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4116 | |
| 4117 | <h4>Preferences setup:</h4> |
| 4118 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4119 | <p>The XML Catalog spec requires the possibility to select defaultpreferences |
| 4120 | between public and system delegation,xmlCatalogSetDefaultPrefer() allows |
| 4121 | this, xmlCatalogSetDefaults() andxmlCatalogGetDefaults() allow to control if |
| 4122 | XML Catalogs resolution shouldbe forbidden, allowed for global catalog, for |
| 4123 | document catalog or both, thedefault is to allow both.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4124 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4125 | <p>And of course xmlCatalogSetDebug() allows to generate debug |
| 4126 | messages(through the xmlGenericError() mechanism).</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4127 | |
| 4128 | <h4>Querying routines:</h4> |
| 4129 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4130 | <p>xmlCatalogResolve(), xmlCatalogResolveSystem(), |
| 4131 | xmlCatalogResolvePublic()and xmlCatalogResolveURI() are relatively explicit |
| 4132 | if you read the XMLCatalog specification they correspond to section 7 |
| 4133 | algorithms, they shouldalso work if you have loaded an SGML catalog with a |
| 4134 | simplified semantic.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4135 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4136 | <p>xmlCatalogLocalResolve() and xmlCatalogLocalResolveURI() are the same |
| 4137 | butoperate on the document catalog list</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4138 | |
| 4139 | <h4>Cleanup and Miscellaneous:</h4> |
| 4140 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4141 | <p>xmlCatalogCleanup() free-up the global catalog, xmlCatalogFreeLocal() |
| 4142 | isthe per-document equivalent.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4143 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4144 | <p>xmlCatalogAdd() and xmlCatalogRemove() are used to dynamically modify |
| 4145 | thefirst catalog in the global list, and xmlCatalogDump() allows to dump |
| 4146 | acatalog state, those routines are primarily designed for xmlcatalog, I'm |
| 4147 | notsure that exposing more complex interfaces (like navigation ones) would |
| 4148 | bereally useful.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4149 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4150 | <p>The xmlParseCatalogFile() is a function used to load XML Catalog |
| 4151 | files,it's similar as xmlParseFile() except it bypass all catalog lookups, |
| 4152 | it'sprovided because this functionality may be useful for client tools.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4153 | |
| 4154 | <h4>threaded environments:</h4> |
| 4155 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4156 | <p>Since the catalog tree is built progressively, some care has been taken |
| 4157 | totry to avoid troubles in multithreaded environments. The code is now |
| 4158 | threadsafe assuming that the libxml2 library has been compiled with |
| 4159 | threadssupport.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4160 | |
| 4161 | <p></p> |
| 4162 | |
| 4163 | <h3><a name="Other">Other resources</a></h3> |
| 4164 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4165 | <p>The XML Catalog specification is relatively recent so there isn't |
| 4166 | muchliterature to point at:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4167 | <ul> |
Daniel Veillard | 63d8314 | 2002-05-20 06:51:05 +0000 | [diff] [blame] | 4168 | <li>You can find a good rant from Norm Walsh about <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4169 | href="http://www.arbortext.com/Think_Tank/XML_Resources/Issue_Three/issue_three.html">theneed |
| 4170 | for catalogs</a>, it provides a lot of context informations even ifI |
| 4171 | don't agree with everything presented. Norm also wrote a more |
| 4172 | recentarticle <a |
| 4173 | href="http://wwws.sun.com/software/xml/developers/resolver/article/">XMLentities |
| 4174 | and URI resolvers</a>describing them.</li> |
| 4175 | <li>An <a href="http://home.ccil.org/~cowan/XML/XCatalog.html">old |
| 4176 | XMLcatalog proposal</a>from John Cowan</li> |
| 4177 | <li>The <a href="http://www.rddl.org/">Resource Directory |
| 4178 | DescriptionLanguage</a>(RDDL) another catalog system but more oriented |
| 4179 | towardproviding metadata for XML namespaces.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4180 | <li>the page from the OASIS Technical <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4181 | href="http://www.oasis-open.org/committees/entity/">Committee on |
| 4182 | EntityResolution</a>who maintains XML Catalog, you will find pointers to |
| 4183 | thespecification update, some background and pointers to others |
| 4184 | toolsproviding XML Catalog support</li> |
| 4185 | <li>There is a <a href="buildDocBookCatalog">shell script</a>to generateXML |
| 4186 | Catalogs for DocBook 4.1.2 . If it can write to the /etc/xml/directory, |
| 4187 | it will set-up /etc/xml/catalog and /etc/xml/docbook based onthe |
| 4188 | resources found on the system. Otherwise it will just create~/xmlcatalog |
| 4189 | and ~/dbkxmlcatalog and doing: |
Daniel Veillard | 8594de9 | 2003-04-25 10:08:44 +0000 | [diff] [blame] | 4190 | <p><code>export XML_CATALOG_FILES=$HOME/xmlcatalog</code></p> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4191 | <p>should allow to process DocBook documentations without |
| 4192 | requiringnetwork accesses for the DTD or stylesheets</p> |
Daniel Veillard | 35e937a | 2002-01-19 22:21:54 +0000 | [diff] [blame] | 4193 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4194 | <li>I have uploaded <a |
| 4195 | href="ftp://xmlsoft.org/libxml2/test/dbk412catalog.tar.gz">asmall |
| 4196 | tarball</a>containing XML Catalogs for DocBook 4.1.2 which seemsto work |
| 4197 | fine for me too</li> |
| 4198 | <li>The <a |
| 4199 | href="http://www.xmlsoft.org/xmlcatalog_man.html">xmlcatalogmanual |
| 4200 | page</a></li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4201 | </ul> |
| 4202 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4203 | <p>If you have suggestions for corrections or additions, simply contactme:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4204 | |
| 4205 | <h2><a name="library">The parser interfaces</a></h2> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4206 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4207 | <p>This section is directly intended to help programmers getting |
| 4208 | bootstrappedusing the XML tollkit from the C language. It is not intended to |
| 4209 | beextensive. I hope the automatically generated documents will provide |
| 4210 | thecompleteness required, but as a separate set of documents. The interfaces |
| 4211 | ofthe XML parser are by principle low level, Those interested in a higher |
| 4212 | levelAPI should <a href="#DOM">look at DOM</a>.</p> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 4213 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4214 | <p>The <a href="html/libxml-parser.html">parser interfaces for |
| 4215 | XML</a>areseparated from the <a href="html/libxml-htmlparser.html">HTML |
| 4216 | parserinterfaces</a>. Let's have a look at how the XML parser can be |
| 4217 | called:</p> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4218 | |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4219 | <h3><a name="Invoking">Invoking the parser : the pull method</a></h3> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4220 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4221 | <p>Usually, the first thing to do is to read an XML input. The parser |
| 4222 | acceptsdocuments either from in-memory strings or from files. The functions |
| 4223 | aredefined in "parser.h":</p> |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 4224 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4225 | <dt><code>xmlDocPtr xmlParseMemory(char *buffer, int size);</code></dt> |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4226 | <dd><p>Parse a null-terminated string containing the document.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4227 | </dd> |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 4228 | </dl> |
| 4229 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4230 | <dt><code>xmlDocPtr xmlParseFile(const char *filename);</code></dt> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4231 | <dd><p>Parse an XML document contained in a (possibly compressed)file.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4232 | </dd> |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 4233 | </dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4234 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4235 | <p>The parser returns a pointer to the document structure (or NULL in case |
| 4236 | offailure).</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4237 | |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4238 | <h3 id="Invoking1">Invoking the parser: the push method</h3> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4239 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4240 | <p>In order for the application to keep the control when the document isbeing |
| 4241 | fetched (which is common for GUI based programs) libxml2 provides apush |
| 4242 | interface, too, as of version 1.8.3. Here are the interfacefunctions:</p> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4243 | <pre>xmlParserCtxtPtr xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, |
| 4244 | void *user_data, |
| 4245 | const char *chunk, |
| 4246 | int size, |
| 4247 | const char *filename); |
| 4248 | int xmlParseChunk (xmlParserCtxtPtr ctxt, |
| 4249 | const char *chunk, |
| 4250 | int size, |
| 4251 | int terminate);</pre> |
| 4252 | |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4253 | <p>and here is a simple example showing how to use the interface:</p> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4254 | <pre> FILE *f; |
| 4255 | |
| 4256 | f = fopen(filename, "r"); |
| 4257 | if (f != NULL) { |
| 4258 | int res, size = 1024; |
| 4259 | char chars[1024]; |
| 4260 | xmlParserCtxtPtr ctxt; |
| 4261 | |
| 4262 | res = fread(chars, 1, 4, f); |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4263 | if (res > 0) { |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4264 | ctxt = xmlCreatePushParserCtxt(NULL, NULL, |
| 4265 | chars, res, filename); |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4266 | while ((res = fread(chars, 1, size, f)) > 0) { |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4267 | xmlParseChunk(ctxt, chars, res, 0); |
| 4268 | } |
| 4269 | xmlParseChunk(ctxt, chars, 0, 1); |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4270 | doc = ctxt->myDoc; |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4271 | xmlFreeParserCtxt(ctxt); |
| 4272 | } |
| 4273 | }</pre> |
| 4274 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4275 | <p>The HTML parser embedded into libxml2 also has a push interface; |
| 4276 | thefunctions are just prefixed by "html" rather than "xml".</p> |
Daniel Veillard | 0142b84 | 2000-01-14 14:45:24 +0000 | [diff] [blame] | 4277 | |
| 4278 | <h3 id="Invoking2">Invoking the parser: the SAX interface</h3> |
| 4279 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4280 | <p>The tree-building interface makes the parser memory-hungry, first |
| 4281 | loadingthe document in memory and then building the tree itself. Reading a |
| 4282 | documentwithout building the tree is possible using the SAX interfaces (see |
| 4283 | SAX.h and<a |
| 4284 | href="http://www.daa.com.au/~james/gnome/xml-sax/xml-sax.html">JamesHenstridge's |
| 4285 | documentation</a>). Note also that the push interface can belimited to SAX: |
| 4286 | just use the two first arguments of<code>xmlCreatePushParserCtxt()</code>.</p> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 4287 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 4288 | <h3><a name="Building">Building a tree from scratch</a></h3> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4289 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4290 | <p>The other way to get an XML tree in memory is by building it. |
| 4291 | Basicallythere is a set of functions dedicated to building new elements. |
| 4292 | (These arealso described in <libxml/tree.h>.) For example, here is a |
| 4293 | piece ofcode that produces the XML document used in the previous examples:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4294 | <pre> #include <libxml/tree.h> |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 4295 | xmlDocPtr doc; |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4296 | xmlNodePtr tree, subtree; |
| 4297 | |
| 4298 | doc = xmlNewDoc("1.0"); |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4299 | doc->children = xmlNewDocNode(doc, NULL, "EXAMPLE", NULL); |
| 4300 | xmlSetProp(doc->children, "prop1", "gnome is great"); |
| 4301 | xmlSetProp(doc->children, "prop2", "& linux too"); |
| 4302 | tree = xmlNewChild(doc->children, NULL, "head", NULL); |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4303 | subtree = xmlNewChild(tree, NULL, "title", "Welcome to Gnome"); |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4304 | tree = xmlNewChild(doc->children, NULL, "chapter", NULL); |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4305 | subtree = xmlNewChild(tree, NULL, "title", "The Linux adventure"); |
| 4306 | subtree = xmlNewChild(tree, NULL, "p", "bla bla bla ..."); |
| 4307 | subtree = xmlNewChild(tree, NULL, "image", NULL); |
| 4308 | xmlSetProp(subtree, "href", "linus.gif");</pre> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4309 | |
| 4310 | <p>Not really rocket science ...</p> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4311 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 4312 | <h3><a name="Traversing">Traversing the tree</a></h3> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4313 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4314 | <p>Basically by <a href="html/libxml-tree.html">including |
| 4315 | "tree.h"</a>yourcode has access to the internal structure of all the elements |
| 4316 | of the tree.The names should be somewhat simple like |
| 4317 | <strong>parent</strong>,<strong>children</strong>, <strong>next</strong>, |
| 4318 | <strong>prev</strong>,<strong>properties</strong>, etc... For example, still |
| 4319 | with the previousexample:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4320 | <pre><code>doc->children->children->children</code></pre> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4321 | |
| 4322 | <p>points to the title element,</p> |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 4323 | <pre>doc->children->children->next->children->children</pre> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4324 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4325 | <p>points to the text node containing the chapter title "The |
| 4326 | Linuxadventure".</p> |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 4327 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4328 | <p><strong>NOTE</strong>: XML allows <em>PI</em>s and <em>comments</em>to |
| 4329 | bepresent before the document root, so <code>doc->children</code>may |
| 4330 | pointto an element which is not the document Root Element; a |
| 4331 | function<code>xmlDocGetRootElement()</code>was added for this purpose.</p> |
Daniel Veillard | b24054a | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 4332 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 4333 | <h3><a name="Modifying">Modifying the tree</a></h3> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4334 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4335 | <p>Functions are provided for reading and writing the document content. |
| 4336 | Hereis an excerpt from the <a href="html/libxml-tree.html">tree API</a>:</p> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4337 | <dl> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4338 | <dt><code>xmlAttrPtr xmlSetProp(xmlNodePtr node, const xmlChar *name, |
| 4339 | constxmlChar *value);</code></dt> |
| 4340 | <dd><p>This sets (or changes) an attribute carried by an ELEMENT node.The |
| 4341 | value can be NULL.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4342 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4343 | </dl> |
| 4344 | <dl> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4345 | <dt><code>const xmlChar *xmlGetProp(xmlNodePtr node, const |
| 4346 | xmlChar*name);</code></dt> |
| 4347 | <dd><p>This function returns a pointer to new copy of the |
| 4348 | propertycontent. Note that the user must deallocate the result.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4349 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4350 | </dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4351 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4352 | <p>Two functions are provided for reading and writing the text associatedwith |
| 4353 | elements:</p> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4354 | <dl> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4355 | <dt><code>xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const |
| 4356 | xmlChar*value);</code></dt> |
| 4357 | <dd><p>This function takes an "external" string and converts it to |
| 4358 | onetext node or possibly to a list of entity and text nodes. |
| 4359 | Allnon-predefined entity references like &Gnome; will be |
| 4360 | storedinternally as entity nodes, hence the result of the function may |
| 4361 | not bea single node.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4362 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4363 | </dl> |
| 4364 | <dl> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4365 | <dt><code>xmlChar *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, |
| 4366 | intinLine);</code></dt> |
| 4367 | <dd><p>This function is the inverse |
| 4368 | of<code>xmlStringGetNodeList()</code>. It generates a new |
| 4369 | stringcontaining the content of the text and entity nodes. Note the |
| 4370 | extraargument inLine. If this argument is set to 1, the function will |
| 4371 | expandentity references. For example, instead of returning the |
| 4372 | &Gnome;XML encoding in the string, it will substitute it with its |
| 4373 | value (say,"GNU Network Object Model Environment").</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4374 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4375 | </dl> |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 4376 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 4377 | <h3><a name="Saving">Saving a tree</a></h3> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4378 | |
| 4379 | <p>Basically 3 options are possible:</p> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4380 | <dl> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4381 | <dt><code>void xmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, |
| 4382 | int*size);</code></dt> |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4383 | <dd><p>Returns a buffer into which the document has been saved.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4384 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4385 | </dl> |
| 4386 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4387 | <dt><code>extern void xmlDocDump(FILE *f, xmlDocPtr doc);</code></dt> |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4388 | <dd><p>Dumps a document to an open file descriptor.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4389 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4390 | </dl> |
| 4391 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4392 | <dt><code>int xmlSaveFile(const char *filename, xmlDocPtr cur);</code></dt> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4393 | <dd><p>Saves the document to a file. In this case, the |
| 4394 | compressioninterface is triggered if it has been turned on.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4395 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4396 | </dl> |
Daniel Veillard | 10c6a8f | 1998-10-28 01:00:12 +0000 | [diff] [blame] | 4397 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 4398 | <h3><a name="Compressio">Compression</a></h3> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4399 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4400 | <p>The library transparently handles compression when doing |
| 4401 | file-basedaccesses. The level of compression on saves can be turned on either |
| 4402 | globallyor individually for one file:</p> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4403 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4404 | <dt><code>int xmlGetDocCompressMode (xmlDocPtr doc);</code></dt> |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4405 | <dd><p>Gets the document compression ratio (0-9).</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4406 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4407 | </dl> |
| 4408 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4409 | <dt><code>void xmlSetDocCompressMode (xmlDocPtr doc, int mode);</code></dt> |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4410 | <dd><p>Sets the document compression ratio.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4411 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4412 | </dl> |
| 4413 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4414 | <dt><code>int xmlGetCompressMode(void);</code></dt> |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4415 | <dd><p>Gets the default compression ratio.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4416 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4417 | </dl> |
| 4418 | <dl> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4419 | <dt><code>void xmlSetCompressMode(int mode);</code></dt> |
Daniel Veillard | 88f00ae | 2000-03-02 00:15:55 +0000 | [diff] [blame] | 4420 | <dd><p>Sets the default compression ratio.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4421 | </dd> |
Daniel Veillard | 25940b7 | 1998-10-29 05:51:30 +0000 | [diff] [blame] | 4422 | </dl> |
| 4423 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 4424 | <h2><a name="Entities">Entities or no entities</a></h2> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4425 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4426 | <p>Entities in principle are similar to simple C macros. An entity defines |
| 4427 | anabbreviation for a given string that you can reuse many times throughout |
| 4428 | thecontent of your document. Entities are especially useful when a given |
| 4429 | stringmay occur frequently within a document, or to confine the change needed |
| 4430 | to adocument to a restricted area in the internal subset of the document (at |
| 4431 | thebeginning). Example:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4432 | <pre>1 <?xml version="1.0"?> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4433 | 2 <!DOCTYPE EXAMPLE SYSTEM "example.dtd" [ |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4434 | 3 <!ENTITY xml "Extensible Markup Language"> |
| 4435 | 4 ]> |
| 4436 | 5 <EXAMPLE> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4437 | 6 &xml; |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4438 | 7 </EXAMPLE></pre> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4439 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4440 | <p>Line 3 declares the xml entity. Line 6 uses the xml entity, by |
| 4441 | prefixingits name with '&' and following it by ';' without any spaces |
| 4442 | added. Thereare 5 predefined entities in libxml2 allowing you to escape |
| 4443 | characters withpredefined meaning in some parts of the xml document |
| 4444 | content:<strong>&lt;</strong>for the character '<', |
| 4445 | <strong>&gt;</strong>for the character '>', |
| 4446 | <strong>&apos;</strong>for the character |
| 4447 | ''',<strong>&quot;</strong>for the character '"', |
| 4448 | and<strong>&amp;</strong>for the character '&'.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4449 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4450 | <p>One of the problems related to entities is that you may want the parser |
| 4451 | tosubstitute an entity's content so that you can see the replacement text |
| 4452 | inyour application. Or you may prefer to keep entity references as such in |
| 4453 | thecontent to be able to save the document back without losing this |
| 4454 | usuallyprecious information (if the user went through the pain of |
| 4455 | explicitlydefining entities, he may have a a rather negative attitude if you |
| 4456 | blindlysubstitute them as saving time). The <a |
| 4457 | href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault()</a>function |
| 4458 | allows you to check and change the behaviour, which is to notsubstitute |
| 4459 | entities by default.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4460 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4461 | <p>Here is the DOM tree built by libxml2 for the previous document in |
| 4462 | thedefault case:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4463 | <pre>/gnome/src/gnome-xml -> ./xmllint --debug test/ent1 |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4464 | DOCUMENT |
| 4465 | version=1.0 |
| 4466 | ELEMENT EXAMPLE |
| 4467 | TEXT |
| 4468 | content= |
| 4469 | ENTITY_REF |
| 4470 | INTERNAL_GENERAL_ENTITY xml |
| 4471 | content=Extensible Markup Language |
| 4472 | TEXT |
| 4473 | content=</pre> |
| 4474 | |
| 4475 | <p>And here is the result when substituting entities:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4476 | <pre>/gnome/src/gnome-xml -> ./tester --debug --noent test/ent1 |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4477 | DOCUMENT |
| 4478 | version=1.0 |
| 4479 | ELEMENT EXAMPLE |
| 4480 | TEXT |
| 4481 | content= Extensible Markup Language</pre> |
| 4482 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4483 | <p>So, entities or no entities? Basically, it depends on your use case. |
| 4484 | Isuggest that you keep the non-substituting default behaviour and avoid |
| 4485 | usingentities in your XML document or data if you are not willing to handle |
| 4486 | theentity references elements in the DOM tree.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4487 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4488 | <p>Note that at save time libxml2 enforces the conversion of the |
| 4489 | predefinedentities where necessary to prevent well-formedness problems, and |
| 4490 | will alsotransparently replace those with chars (i.e. it will not generate |
| 4491 | entityreference elements in the DOM tree or call the reference() SAX callback |
| 4492 | whenfinding them in the input).</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4493 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4494 | <p><span style="background-color: #FF0000">WARNING</span>: handling |
| 4495 | entitieson top of the libxml2 SAX interface is difficult!!! If you plan to |
| 4496 | usenon-predefined entities in your documents, then the learning curve to |
| 4497 | handlethen using the SAX API may be long. If you plan to use complex |
| 4498 | documents, Istrongly suggest you consider using the DOM interface instead and |
| 4499 | let libxmldeal with the complexity rather than trying to do it yourself.</p> |
Daniel Veillard | 7b9c4b7 | 2000-08-25 16:26:50 +0000 | [diff] [blame] | 4500 | |
Daniel Veillard | 2f4dfc4 | 1999-09-24 14:03:48 +0000 | [diff] [blame] | 4501 | <h2><a name="Namespaces">Namespaces</a></h2> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4502 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 4503 | <p>The libxml2 library implements <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4504 | href="http://www.w3.org/TR/REC-xml-names/">XML namespaces</a>support |
| 4505 | byrecognizing namespace constructs in the input, and does namespace |
| 4506 | lookupautomatically when building the DOM tree. A namespace declaration |
| 4507 | isassociated with an in-memory structure and all elements or attributes |
| 4508 | withinthat namespace point to it. Hence testing the namespace is a simple and |
| 4509 | fastequality operation at the user level.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4510 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4511 | <p>I suggest that people using libxml2 use a namespace, and declare it in |
| 4512 | theroot element of their document as the default namespace. Then they don't |
| 4513 | needto use the prefix in the content but we will have a basis for future |
| 4514 | semanticrefinement and merging of data from different sources. This doesn't |
| 4515 | increasethe size of the XML output significantly, but significantly increases |
| 4516 | itsvalue in the long-term. Example:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4517 | <pre><mydoc xmlns="http://mydoc.example.org/schemas/"> |
| 4518 | <elem1>...</elem1> |
| 4519 | <elem2>...</elem2> |
| 4520 | </mydoc></pre> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4521 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4522 | <p>The namespace value has to be an absolute URL, but the URL doesn't have |
| 4523 | topoint to any existing resource on the Web. It will bind all the element |
| 4524 | andattributes with that URL. I suggest to use an URL within a domain |
| 4525 | youcontrol, and that the URL should contain some kind of version information |
| 4526 | ifpossible. For example, <code>"http://www.gnome.org/gnumeric/1.0/"</code>is |
| 4527 | agood namespace scheme.</p> |
Daniel Veillard | ec30341 | 2000-03-24 13:41:54 +0000 | [diff] [blame] | 4528 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4529 | <p>Then when you load a file, make sure that a namespace carrying |
| 4530 | theversion-independent prefix is installed on the root element of your |
| 4531 | document,and if the version information don't match something you know, warn |
| 4532 | the userand be liberal in what you accept as the input. Also do *not* try to |
| 4533 | basenamespace checking on the prefix value. <foo:text> may be exactly |
| 4534 | thesame as <bar:text> in another document. What really matters is the |
| 4535 | URIassociated with the element or the attribute, not the prefix string (which |
| 4536 | isjust a shortcut for the full URI). In libxml, element and attributes have |
| 4537 | an<code>ns</code>field pointing to an xmlNs structure detailing the |
| 4538 | namespaceprefix and its URI.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4539 | |
| 4540 | <p>@@Interfaces@@</p> |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 4541 | <pre>xmlNodePtr node; |
Daniel Veillard | fc8dc35 | 2003-10-18 09:07:46 +0000 | [diff] [blame] | 4542 | if(!strncmp(node->name,"mytag",5) |
| 4543 | && node->ns |
| 4544 | && !strcmp(node->ns->href,"http://www.mysite.com/myns/1.0")) { |
| 4545 | ... |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 4546 | }</pre> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4547 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4548 | <p>Usually people object to using namespaces together with validity |
| 4549 | checking.I will try to make sure that using namespaces won't break validity |
| 4550 | checking,so even if you plan to use or currently are using validation I |
| 4551 | stronglysuggest adding namespaces to your document. A default namespace |
| 4552 | scheme<code>xmlns="http://...."</code>should not break validity even on |
| 4553 | lessflexible parsers. Using namespaces to mix and differentiate content |
| 4554 | comingfrom multiple DTDs will certainly break current validation schemes. To |
| 4555 | checksuch documents one needs to use schema-validation, which is supported |
| 4556 | inlibxml2 as well. See <a href="http://www.relaxng.org/">relagx-ng</a>and <a |
Daniel Veillard | 3e35f8e | 2003-10-21 00:05:38 +0000 | [diff] [blame] | 4557 | href="http://www.w3c.org/XML/Schema">w3c-schema</a>.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4558 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4559 | <h2><a name="Upgrading">Upgrading 1.x code</a></h2> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4560 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4561 | <p>Incompatible changes:</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4562 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4563 | <p>Version 2 of libxml2 is the first version introducing serious |
| 4564 | backwardincompatible changes. The main goals were:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4565 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4566 | <li>a general cleanup. A number of mistakes inherited from the very |
| 4567 | earlyversions couldn't be changed due to compatibility constraints. |
| 4568 | Examplethe "childs" element in the nodes.</li> |
| 4569 | <li>Uniformization of the various nodes, at least for their header and |
| 4570 | linkparts (doc, parent, children, prev, next), the goal is a |
| 4571 | simplerprogramming model and simplifying the task of the DOM |
| 4572 | implementors.</li> |
| 4573 | <li>better conformances to the XML specification, for example version |
| 4574 | 1.xhad an heuristic to try to detect ignorable white spaces. As a result |
| 4575 | theSAX event generated were ignorableWhitespace() while the spec |
| 4576 | requirescharacter() in that case. This also mean that a number of DOM |
| 4577 | nodecontaining blank text may populate the DOM tree which were not |
| 4578 | presentbefore.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4579 | </ul> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4580 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4581 | <h3>How to fix libxml-1.x code:</h3> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4582 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4583 | <p>So client code of libxml designed to run with version 1.x may have to |
| 4584 | bechanged to compile against version 2.x of libxml. Here is a list of |
| 4585 | changesthat I have collected, they may not be sufficient, so in case you find |
| 4586 | otherchange which are required, <a href="mailto:Daniel.Veillard@w3.org">drop |
| 4587 | me amail</a>:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4588 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4589 | <li>The package name have changed from libxml to libxml2, the library |
| 4590 | nameis now -lxml2 . There is a new xml2-config script which should be |
| 4591 | used toselect the right parameters libxml2</li> |
| 4592 | <li>Node <strong>childs</strong>field has been |
| 4593 | renamed<strong>children</strong>so s/childs/children/g should be |
| 4594 | applied(probability of having "childs" anywhere else is close to 0+</li> |
| 4595 | <li>The document don't have anymore a <strong>root</strong>element it |
| 4596 | hasbeen replaced by <strong>children</strong>and usually you will get |
| 4597 | alist of element here. For example a Dtd element for the internal |
| 4598 | subsetand it's declaration may be found in that list, as well as |
| 4599 | processinginstructions or comments found before or after the document |
| 4600 | root element.Use <strong>xmlDocGetRootElement(doc)</strong>to get the |
| 4601 | root element ofa document. Alternatively if you are sure to not reference |
| 4602 | DTDs nor havePIs or comments before or after the root |
| 4603 | elements/->root/->children/g will probably do it.</li> |
| 4604 | <li>The white space issue, this one is more complex, unless special case |
| 4605 | ofvalidating parsing, the line breaks and spaces usually used for |
| 4606 | indentingand formatting the document content becomes significant. So they |
| 4607 | arereported by SAX and if your using the DOM tree, corresponding nodes |
| 4608 | aregenerated. Too approach can be taken: |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4609 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4610 | <li>lazy one, use the compatibility |
| 4611 | call<strong>xmlKeepBlanksDefault(0)</strong>but be aware that you |
| 4612 | arerelying on a special (and possibly broken) set of heuristics |
| 4613 | oflibxml to detect ignorable blanks. Don't complain if it breaks |
| 4614 | ormake your application not 100% clean w.r.t. to it's input.</li> |
| 4615 | <li>the Right Way: change you code to accept possibly |
| 4616 | insignificantblanks characters, or have your tree populated with |
| 4617 | weird blank textnodes. You can spot them using the commodity |
| 4618 | function<strong>xmlIsBlankNode(node)</strong>returning 1 for such |
| 4619 | blanknodes.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4620 | </ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4621 | <p>Note also that with the new default the output functions don't add |
| 4622 | anyextra indentation when saving a tree in order to be able to round |
| 4623 | trip(read and save) without inflating the document with extra |
| 4624 | formattingchars.</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4625 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4626 | <li>The include path has changed to $prefix/libxml/ and the |
| 4627 | includesthemselves uses this new prefix in includes instructions... If |
| 4628 | you areusing (as expected) the |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4629 | <pre>xml2-config --cflags</pre> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4630 | <p>output to generate you compile commands this will probably work out |
| 4631 | ofthe box</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4632 | </li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4633 | <li>xmlDetectCharEncoding takes an extra argument indicating the length |
| 4634 | inbyte of the head of the document available for character detection.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4635 | </ol> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4636 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4637 | <h3>Ensuring both libxml-1.x and libxml-2.x compatibility</h3> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4638 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4639 | <p>Two new version of libxml (1.8.11) and libxml2 (2.3.4) have been |
| 4640 | releasedto allow smooth upgrade of existing libxml v1code while |
| 4641 | retainingcompatibility. They offers the following:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4642 | <ol> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4643 | <li>similar include naming, one should |
| 4644 | use<strong>#include<libxml/...></strong>in both cases.</li> |
| 4645 | <li>similar identifiers defined via macros for the child and root |
| 4646 | fields:respectively |
| 4647 | <strong>xmlChildrenNode</strong>and<strong>xmlRootNode</strong></li> |
| 4648 | <li>a new macro <strong>LIBXML_TEST_VERSION</strong>which should beinserted |
| 4649 | once in the client code</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4650 | </ol> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4651 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4652 | <p>So the roadmap to upgrade your existing libxml applications is |
| 4653 | thefollowing:</p> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4654 | <ol> |
| 4655 | <li>install the libxml-1.8.8 (and libxml-devel-1.8.8) packages</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4656 | <li>find all occurrences where the xmlDoc <strong>root</strong>field isused |
| 4657 | and change it to <strong>xmlRootNode</strong></li> |
| 4658 | <li>similarly find all occurrences where the |
| 4659 | xmlNode<strong>childs</strong>field is used and change it |
| 4660 | to<strong>xmlChildrenNode</strong></li> |
| 4661 | <li>add a <strong>LIBXML_TEST_VERSION</strong>macro somewhere in |
| 4662 | your<strong>main()</strong>or in the library init entry point</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4663 | <li>Recompile, check compatibility, it should still work</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4664 | <li>Change your configure script to look first for xml2-config and fallback |
| 4665 | using xml-config . Use the --cflags and --libs output of the commandas |
| 4666 | the Include and Linking parameters needed to use libxml.</li> |
| 4667 | <li>install libxml2-2.3.x and libxml2-devel-2.3.x (libxml-1.8.y |
| 4668 | andlibxml-devel-1.8.y can be kept simultaneously)</li> |
| 4669 | <li>remove your config.cache, relaunch your configuration mechanism, |
| 4670 | andrecompile, if steps 2 and 3 were done right it should compile |
| 4671 | as-is</li> |
| 4672 | <li>Test that your application is still running correctly, if not this |
| 4673 | maybe due to extra empty nodes due to formating spaces being kept in |
| 4674 | libxml2contrary to libxml1, in that case insert xmlKeepBlanksDefault(1) |
| 4675 | in yourcode before calling the parser (next |
| 4676 | to<strong>LIBXML_TEST_VERSION</strong>is a fine place).</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4677 | </ol> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4678 | |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4679 | <p>Following those steps should work. It worked for some of my own code.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4680 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4681 | <p>Let me put some emphasis on the fact that there is far more changes |
| 4682 | fromlibxml 1.x to 2.x than the ones you may have to patch for. The overall |
| 4683 | codehas been considerably cleaned up and the conformance to the XML |
| 4684 | specificationhas been drastically improved too. Don't take those changes as |
| 4685 | an excuse tonot upgrade, it may cost a lot on the long term ...</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4686 | |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 4687 | <h2><a name="Thread">Thread safety</a></h2> |
| 4688 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4689 | <p>Starting with 2.4.7, libxml2 makes provisions to ensure that |
| 4690 | concurrentthreads can safely work in parallel parsing different documents. |
| 4691 | There ishowever a couple of things to do to ensure it:</p> |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 4692 | <ul> |
| 4693 | <li>configure the library accordingly using the --with-threads options</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4694 | <li>call xmlInitParser() in the "main" thread before using any of |
| 4695 | thelibxml2 API (except possibly selecting a different memory |
| 4696 | allocator)</li> |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 4697 | </ul> |
| 4698 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4699 | <p>Note that the thread safety cannot be ensured for multiple threads |
| 4700 | sharingthe same document, the locking must be done at the application level, |
| 4701 | libxmlexports a basic mutex and reentrant mutexes API in |
| 4702 | <libxml/threads.h>.The parts of the library checked for thread safety |
| 4703 | are:</p> |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 4704 | <ul> |
| 4705 | <li>concurrent loading</li> |
| 4706 | <li>file access resolution</li> |
| 4707 | <li>catalog access</li> |
| 4708 | <li>catalog building</li> |
| 4709 | <li>entities lookup/accesses</li> |
| 4710 | <li>validation</li> |
| 4711 | <li>global variables per-thread override</li> |
| 4712 | <li>memory handling</li> |
| 4713 | </ul> |
| 4714 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4715 | <p>XPath is supposed to be thread safe now, but this wasn't |
| 4716 | testedseriously.</p> |
Daniel Veillard | 52dcab3 | 2001-10-30 12:51:17 +0000 | [diff] [blame] | 4717 | |
Daniel Veillard | 3500838 | 1999-10-25 13:15:52 +0000 | [diff] [blame] | 4718 | <h2><a name="DOM"></a><a name="Principles">DOM Principles</a></h2> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4719 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4720 | <p><a href="http://www.w3.org/DOM/">DOM</a>stands for the <em>DocumentObject |
| 4721 | Model</em>; this is an API for accessing XML or HTML structureddocuments. |
| 4722 | Native support for DOM in Gnome is on the way (module gnome-dom),and will be |
| 4723 | based on gnome-xml. This will be a far cleaner interface tomanipulate XML |
| 4724 | files within Gnome since it won't expose the internalstructure.</p> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4725 | |
Daniel Veillard | 8a46917 | 2003-06-12 16:05:07 +0000 | [diff] [blame] | 4726 | <p>The current DOM implementation on top of libxml2 is the <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4727 | href="http://cvs.gnome.org/lxr/source/gdome2/">gdome2 Gnome module</a>, |
| 4728 | thisis a full DOM interface, thanks to Paolo Casarini, check the <a |
| 4729 | href="http://www.cs.unibo.it/~casarini/gdome2/">Gdome2 homepage</a>for |
| 4730 | moreinformations.</p> |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4731 | |
Daniel Veillard | 3500838 | 1999-10-25 13:15:52 +0000 | [diff] [blame] | 4732 | <h2><a name="Example"></a><a name="real">A real example</a></h2> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4733 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4734 | <p>Here is a real size example, where the actual content of the |
| 4735 | applicationdata is not kept in the DOM tree but uses internal structures. It |
| 4736 | is based ona proposal to keep a database of jobs related to Gnome, with an |
| 4737 | XML basedstorage structure. Here is an <a href="gjobs.xml">XML encoded |
| 4738 | jobsbase</a>:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4739 | <pre><?xml version="1.0"?> |
| 4740 | <gjob:Helping xmlns:gjob="http://www.gnome.org/some-location"> |
| 4741 | <gjob:Jobs> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4742 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4743 | <gjob:Job> |
| 4744 | <gjob:Project ID="3"/> |
| 4745 | <gjob:Application>GBackup</gjob:Application> |
| 4746 | <gjob:Category>Development</gjob:Category> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4747 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4748 | <gjob:Update> |
| 4749 | <gjob:Status>Open</gjob:Status> |
| 4750 | <gjob:Modified>Mon, 07 Jun 1999 20:27:45 -0400 MET DST</gjob:Modified> |
| 4751 | <gjob:Salary>USD 0.00</gjob:Salary> |
| 4752 | </gjob:Update> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4753 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4754 | <gjob:Developers> |
| 4755 | <gjob:Developer> |
| 4756 | </gjob:Developer> |
| 4757 | </gjob:Developers> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4758 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4759 | <gjob:Contact> |
| 4760 | <gjob:Person>Nathan Clemons</gjob:Person> |
| 4761 | <gjob:Email>nathan@windsofstorm.net</gjob:Email> |
| 4762 | <gjob:Company> |
| 4763 | </gjob:Company> |
| 4764 | <gjob:Organisation> |
| 4765 | </gjob:Organisation> |
| 4766 | <gjob:Webpage> |
| 4767 | </gjob:Webpage> |
| 4768 | <gjob:Snailmail> |
| 4769 | </gjob:Snailmail> |
| 4770 | <gjob:Phone> |
| 4771 | </gjob:Phone> |
| 4772 | </gjob:Contact> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4773 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4774 | <gjob:Requirements> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4775 | The program should be released as free software, under the GPL. |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4776 | </gjob:Requirements> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4777 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4778 | <gjob:Skills> |
| 4779 | </gjob:Skills> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4780 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4781 | <gjob:Details> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4782 | A GNOME based system that will allow a superuser to configure |
| 4783 | compressed and uncompressed files and/or file systems to be backed |
| 4784 | up with a supported media in the system. This should be able to |
| 4785 | perform via find commands generating a list of files that are passed |
| 4786 | to tar, dd, cpio, cp, gzip, etc., to be directed to the tape machine |
| 4787 | or via operations performed on the filesystem itself. Email |
| 4788 | notification and GUI status display very important. |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4789 | </gjob:Details> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4790 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4791 | </gjob:Job> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4792 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4793 | </gjob:Jobs> |
| 4794 | </gjob:Helping></pre> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4795 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4796 | <p>While loading the XML file into an internal DOM tree is a matter ofcalling |
| 4797 | only a couple of functions, browsing the tree to gather the data andgenerate |
| 4798 | the internal structures is harder, and more error prone.</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4799 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4800 | <p>The suggested principle is to be tolerant with respect to the |
| 4801 | inputstructure. For example, the ordering of the attributes is not |
| 4802 | significant,the XML specification is clear about it. It's also usually a good |
| 4803 | idea not todepend on the order of the children of a given node, unless it |
| 4804 | really makesthings harder. Here is some code to parse the information for a |
| 4805 | person:</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4806 | <pre>/* |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4807 | * A person record |
| 4808 | */ |
| 4809 | typedef struct person { |
| 4810 | char *name; |
| 4811 | char *email; |
| 4812 | char *company; |
| 4813 | char *organisation; |
| 4814 | char *smail; |
| 4815 | char *webPage; |
| 4816 | char *phone; |
| 4817 | } person, *personPtr; |
| 4818 | |
| 4819 | /* |
| 4820 | * And the code needed to parse it |
| 4821 | */ |
| 4822 | personPtr parsePerson(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { |
| 4823 | personPtr ret = NULL; |
| 4824 | |
| 4825 | DEBUG("parsePerson\n"); |
| 4826 | /* |
| 4827 | * allocate the struct |
| 4828 | */ |
| 4829 | ret = (personPtr) malloc(sizeof(person)); |
| 4830 | if (ret == NULL) { |
| 4831 | fprintf(stderr,"out of memory\n"); |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4832 | return(NULL); |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4833 | } |
| 4834 | memset(ret, 0, sizeof(person)); |
| 4835 | |
| 4836 | /* We don't care what the top level element name is */ |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4837 | cur = cur->xmlChildrenNode; |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4838 | while (cur != NULL) { |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4839 | if ((!strcmp(cur->name, "Person")) && (cur->ns == ns)) |
| 4840 | ret->name = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); |
| 4841 | if ((!strcmp(cur->name, "Email")) && (cur->ns == ns)) |
| 4842 | ret->email = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); |
| 4843 | cur = cur->next; |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4844 | } |
| 4845 | |
| 4846 | return(ret); |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4847 | }</pre> |
| 4848 | |
Daniel Veillard | 91e9d58 | 2001-02-26 07:31:12 +0000 | [diff] [blame] | 4849 | <p>Here are a couple of things to notice:</p> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4850 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4851 | <li>Usually a recursive parsing style is the more convenient one: XML |
| 4852 | datais by nature subject to repetitive constructs and usually exhibits |
| 4853 | highlystructured patterns.</li> |
| 4854 | <li>The two arguments of type <em>xmlDocPtr</em>and <em>xmlNsPtr</em>,i.e. |
| 4855 | the pointer to the global XML document and the namespace reserved tothe |
| 4856 | application. Document wide information are needed for example todecode |
| 4857 | entities and it's a good coding practice to define a namespace foryour |
| 4858 | application set of data and test that the element and attributesyou're |
| 4859 | analyzing actually pertains to your application space. This isdone by a |
| 4860 | simple equality test (cur->ns == ns).</li> |
| 4861 | <li>To retrieve text and attributes value, you can use the |
| 4862 | function<em>xmlNodeListGetString</em>to gather all the text and entity |
| 4863 | referencenodes generated by the DOM output and produce an single text |
| 4864 | string.</li> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4865 | </ul> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4866 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4867 | <p>Here is another piece of code used to parse another level of |
| 4868 | thestructure:</p> |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4869 | <pre>#include <libxml/tree.h> |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 4870 | /* |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4871 | * a Description for a Job |
| 4872 | */ |
| 4873 | typedef struct job { |
| 4874 | char *projectID; |
| 4875 | char *application; |
| 4876 | char *category; |
| 4877 | personPtr contact; |
| 4878 | int nbDevelopers; |
| 4879 | personPtr developers[100]; /* using dynamic alloc is left as an exercise */ |
| 4880 | } job, *jobPtr; |
| 4881 | |
| 4882 | /* |
| 4883 | * And the code needed to parse it |
| 4884 | */ |
| 4885 | jobPtr parseJob(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { |
| 4886 | jobPtr ret = NULL; |
| 4887 | |
| 4888 | DEBUG("parseJob\n"); |
| 4889 | /* |
| 4890 | * allocate the struct |
| 4891 | */ |
| 4892 | ret = (jobPtr) malloc(sizeof(job)); |
| 4893 | if (ret == NULL) { |
| 4894 | fprintf(stderr,"out of memory\n"); |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4895 | return(NULL); |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4896 | } |
| 4897 | memset(ret, 0, sizeof(job)); |
| 4898 | |
| 4899 | /* We don't care what the top level element name is */ |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4900 | cur = cur->xmlChildrenNode; |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4901 | while (cur != NULL) { |
| 4902 | |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4903 | if ((!strcmp(cur->name, "Project")) && (cur->ns == ns)) { |
| 4904 | ret->projectID = xmlGetProp(cur, "ID"); |
| 4905 | if (ret->projectID == NULL) { |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4906 | fprintf(stderr, "Project has no ID\n"); |
| 4907 | } |
| 4908 | } |
Daniel Veillard | 60979bd | 2000-07-10 12:17:33 +0000 | [diff] [blame] | 4909 | if ((!strcmp(cur->name, "Application")) && (cur->ns == ns)) |
| 4910 | ret->application = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); |
| 4911 | if ((!strcmp(cur->name, "Category")) && (cur->ns == ns)) |
| 4912 | ret->category = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); |
| 4913 | if ((!strcmp(cur->name, "Contact")) && (cur->ns == ns)) |
| 4914 | ret->contact = parsePerson(doc, ns, cur); |
| 4915 | cur = cur->next; |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4916 | } |
| 4917 | |
| 4918 | return(ret); |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4919 | }</pre> |
Daniel Veillard | 14fff06 | 1999-06-22 21:49:07 +0000 | [diff] [blame] | 4920 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4921 | <p>Once you are used to it, writing this kind of code is quite simple, |
| 4922 | butboring. Ultimately, it could be possible to write stubbers taking either |
| 4923 | Cdata structure definitions, a set of XML examples or an XML DTD and |
| 4924 | producethe code needed to import and export the content between C data and |
| 4925 | XMLstorage. This is left as an exercise to the reader :-)</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4926 | |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4927 | <p>Feel free to use <a href="example/gjobread.c">the code for the full |
| 4928 | Cparsing example</a>as a template, it is also available with Makefile in |
| 4929 | theGnome CVS base under gnome-xml/example</p> |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 4930 | |
Daniel Veillard | c310d56 | 2000-06-23 18:32:15 +0000 | [diff] [blame] | 4931 | <h2><a name="Contributi">Contributions</a></h2> |
| 4932 | <ul> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4933 | <li>Bjorn Reese, William Brack and Thomas Broyer have provided a number |
| 4934 | ofpatches, Gary Pennington worked on the validation API, threading |
| 4935 | supportand Solaris port.</li> |
Daniel Veillard | b8cfbd1 | 2001-10-25 10:53:28 +0000 | [diff] [blame] | 4936 | <li>John Fleck helps maintaining the documentation and man pages.</li> |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4937 | <li><a href="mailto:igor@zlatkovic.com">Igor Zlatkovic</a>is now |
| 4938 | themaintainer of the Windows port, <a |
| 4939 | href="http://www.zlatkovic.com/projects/libxml/index.html">he |
| 4940 | providesbinaries</a></li> |
| 4941 | <li><a href="mailto:Gary.Pennington@sun.com">Gary Pennington</a>provides<a |
| 4942 | href="http://garypennington.net/libxml2/">Solaris binaries</a></li> |
Daniel Veillard | e356c28 | 2001-03-10 12:32:04 +0000 | [diff] [blame] | 4943 | <li><a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4944 | href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">MattSergeant</a>developed |
| 4945 | <a href="http://axkit.org/download/">XML::LibXSLT</a>, a Perl wrapper |
| 4946 | forlibxml2/libxslt as part of the <a href="http://axkit.com/">AxKit |
| 4947 | XMLapplication server</a></li> |
| 4948 | <li><a href="mailto:fnatter@gmx.net">Felix Natter</a>and <a |
| 4949 | href="mailto:geertk@ai.rug.nl">Geert Kloosterman</a>provide <a |
| 4950 | href="libxml-doc.el">an emacs module</a>to lookup libxml(2) |
| 4951 | functionsdocumentation</li> |
| 4952 | <li><a href="mailto:sherwin@nlm.nih.gov">Ziying Sherwin</a>provided <a |
Daniel Veillard | af43f63 | 2002-03-08 15:05:20 +0000 | [diff] [blame] | 4953 | href="http://xmlsoft.org/messages/0488.html">man pages</a></li> |
Daniel Veillard | 5168dbf | 2001-07-07 00:18:23 +0000 | [diff] [blame] | 4954 | <li>there is a module for <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4955 | href="http://acs-misc.sourceforge.net/nsxml.html">libxml/libxslt |
| 4956 | supportin OpenNSD/AOLServer</a></li> |
| 4957 | <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a>provided |
| 4958 | thefirst version of libxml/libxslt <a |
Daniel Veillard | 2d347fa | 2002-03-17 10:34:11 +0000 | [diff] [blame] | 4959 | href="http://www.rexx.com/~dkuhlman">wrappers for Python</a></li> |
Daniel Veillard | 1aadc44 | 2001-11-28 13:10:32 +0000 | [diff] [blame] | 4960 | <li>Petr Kozelka provides <a |
Daniel Veillard | 69839ba | 2006-06-06 13:27:03 +0000 | [diff] [blame^] | 4961 | href="http://sourceforge.net/projects/libxml2-pas">Pascal units to |
| 4962 | gluelibxml2</a>with Kylix and Delphi and other Pascal compilers</li> |
| 4963 | <li><a href="mailto:aleksey@aleksey.com">Aleksey Sanin</a>implemented the<a |
| 4964 | href="http://www.w3.org/Signature/">XML Canonicalization and XMLDigital |
| 4965 | Signature</a><a href="http://www.aleksey.com/xmlsec/">implementations for |
| 4966 | libxml2</a></li> |
| 4967 | <li><a href="mailto:Steve.Ball@explain.com.au">Steve |
| 4968 | Ball</a>andcontributors maintain <a |
| 4969 | href="http://tclxml.sourceforge.net/">tclbindings for libxml2 and |
| 4970 | libxslt</a>, as well as <a |
| 4971 | href="http://tclxml.sf.net/tkxmllint.html">tkxmllint</a>a GUI forxmllint |
| 4972 | and <a href="http://tclxml.sf.net/tkxsltproc.html">tkxsltproc</a>a GUI |
| 4973 | for xsltproc.</li> |
Daniel Veillard | c310d56 | 2000-06-23 18:32:15 +0000 | [diff] [blame] | 4974 | </ul> |
| 4975 | |
Daniel Veillard | c8eab3a | 1999-09-04 18:27:23 +0000 | [diff] [blame] | 4976 | <p></p> |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 4977 | </body> |
| 4978 | </html> |