dom abstraction package
[email protected] (Matt Kynaston)
| Newsgroups | php.xml.dev |
|---|---|
| Message-ID | <1057936538.1965.20.camel@kynx> |
Greetings from userland,
[Tried posting this through the newsgroup interface, but it doesn't seem
to have made it.]
I've just posted a package proposal to pear-dev for a dom abstraction
package:
http://news.php.net/article.php?group=php.pear.dev&article=18170
I thought I'd mention it here for a couple of reasons.
First, there was some discussion on this list about it months back, and
that's what prompted me to eventually sit down and do it.
Second, it includes a test suite which checks the packages for
DOM-compliance (1, 2 or 3). This has a 'raw php5 mode' which runs the
same tests (approx 200 and counting) over PHP5's dom extension. I
initially did this to help me write the abstraction classes for this,
but now it's (sort of) working, I thought it might be of some use to
you.
Last, I've got some questions that came up making the test suite. Not
sure all are actual bugs - if they are let me know and I'll enter them.
1. There's no NodeList or NamedNodeMap objects - getElementsByTagName et
al just return arrays. Is it likely to stay like this?
2. I've seen some weird things happening accessing class properties, and
am wondering if it's a bug.
if ($node) {...} // never true, even when $node
// is a real dom object
return $doc->documentElement; // returns null, but...
$el = $doc->documentElement;
return $el; // returns element as expected!
3. the data attribute of domCharacterData descendents (Comment et al)
returns domtext instead of a string. (My tests mess this one up too -
will fix).
4. $doc->implementation // segfaults
5. Many more... will post once I've got my head round them.
Environment: php-5.0.0b1 (command line), libxml 2.5.8, kernel 2.4.18
Have a good weekend,
Matt