XML in PHP5
| From: | Sterling Hughes | Date: | Thu, 30 Jan 2003 15:02:16 +0000 |
| Subject: | XML in PHP5 | ||
| Groups: | php.xml.dev | ||
| Request: | Send a blank email to php-xml-dev+get-3@lists.php.net to get a copy of this message | ||
[Note: Again, this list is for the development of the PHP5 XML extension
and related ideas. This is not a user support forum, ask user support
questions on php-general@lists.php.net]
Hi,
This list was created to discuss the design and implementation of a
"new" XML extension for PHP5. Christian and I were talking, and we have
many of the same ideas for how this extension should work. This message
however, reflects my views alone. Don't blame Christian if I offend
you, or say something incorrect. :-)
In the past, PHP's XML support has been focused around "a new extension
for everything." You want DOM, ext/domxml, SAX, ext/xml, XSLT,
ext/xslt. However, XML and the related programmatical API's are meant
to integrate with each other seemlessly.
ext/domxml has started to take this direction, it supports in some
variety or another, DOM, Xpath, Xpointer and XSLT. However, the current
extension is flawed in both design and implementation:
- Design. The API does not comply with the W3C specification, although
it does mimic it. XSLT, XPath and XPointer support are not implemented
coherently, but rather are an afterthought.
- Implementation. The extension is poorly designed to take advantage of
the new features in Ze2. The Ze1 implementation is leaky and a bit more
bloated than necessary. For example, memory is not free'd
"on-destruction" but rather on request shutdown, which makes parsing
large XML documents (or a large number of XML documents) quite hard.
For PHP5, I'd like to take the domxml extension, and rework it (still
using the libxml and libxslt libraries) and create a "über-extension,"
which incorporates libxml and libxslt to become the default (and only)
XML extension distributed with PHP.
The first step is planning and outlining development. Let's start by
brainstorming. After that, we'll worry about creating an API to support
our ideas.
In this extension, I think the following features should be supported:
- SAX 2 compliant API.
- DOM 2 compliant API.
- XPath 1.0 compliant interface.
- XSLT 1.0 compliant interface.
- XPointer 1.0 compliant interface.
- XInclude 1.0 compliant interface.
- Streams Support. Streams for accessing documents should be fully
supported so that, for example, someone could easily access and parse a
compressed XML document using the bz2 stream wrapper.
- Extension level interface (the libxml and libxslt libraries should be
seperated from the extension itself). This comes with another idea,
bundled libraries should be separated into php4/bundle and bundling
should be a separate option from enabling or disabling a particular
extension.
- Encoding Options and MbString Integration.
- Compatibility API. DOM 3 and Xpath 2 and XSLT 2 are all coming out
"soonish," and they will be breaking compatibility. We need to have a
built-in way of dealing with these evolving standards.
- Proxy Objects. Provide the user the ability to hook into
transformation stages. For example, when performing an XSLT
transformation, they should have the ability to modify the DOM object
*while* the translation is occuring.
Thoughts? Comments? Questions? Additions?
-Sterling
--
"A business that makes nothing but money is a poor kind of business."
- Henry Ford