Replacing expat with libxml

[email protected] (Sterling Hughes)
Newsgroups php.internals,php.xml.dev
Message-ID <1051482765.25677.15.camel@hasele>
Hi,

After some discussions with various people at the PHP-Con, I decided it
was important that we (at least) have libxml integrated with PHP by
PHP5.  When it comes to XML processing, expat is a legacy library and it
doesn't support nearly what is required for processing XML by todays
standards.

The current version of expat makes processing SOAP documents (for
example) very hard, because XML schema is not available.

On the other hand libxml is a very robust xml processor, providing
support for:

- XML Schema
- DOM
- Validation (against a DTD or Schema)
- SAX
- XML Catalog
- Docbook and HTML Parsers
- XPath, XPointer, XInclude
- Base XML datatypes (XML Schema Part 2)
- FTP and HTTP transports (as well as an IO wrapper library like
Streams)

I've currently completed the first two steps of the integration.  I've
removed the expat library from ext/xml and replaced it with libxml. 
I've also ported the XML extension to use libxml as the underlying
processing engine.

The following incompatibilities exist:

1) some XML_ERROR_ * constants are irrelevant (they are stilled defined,
but they have no meaning for libxml).
2) xml_error_get_string() just returns a blank string.  This can be
changed in the next couple of days, i just need to implement error
strings ontop of libxml error codes.

Having this library bundled internally will allow people to develop
other extensions which use libxml features, and will allow for future
extensions (for example, a fully compliant DOM extension) to easily be
added, without requiring extra bundling.  

Thoughts?

-Sterling

-- 
"The computer programmer is a creator of universes for which he  
 alone is responsible. Universes of virtually unlimited complexity  
 can be created in the form of computer programs." 
    - Joseph Weizenbaum
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.