Andi Gutmans wrote:

We currently have both SimpleXML (for simple things) and DOM to do the more
powerful stuff. They can also be used together without duplicating the
underlying DOM tree which they are working on. You'd have to clearly
articulate the benefits of your suggestion to this couple.
From your email it's not clear what your exact idea is and how it would add
value to these.

I don't want to take sides here but I also think standard DOM interface is a bit cumbersome. I see some places where such class would make things easier. For example:

$body = $doc->createElement('body');
$content = $doc->createCDATASection($text);
$body->appendChild($content);
$item->appendChild($body);

Which could be encapsulated in a slick method like:

public function createTextNode($element, $text, $cdata = false)
{
        $node = $this->_doc->createElement($element);

        if ($cdata) {
                $content = $this->_doc->createCDATASection($text);
                $node->appendChild($conent);
        } else {
                $node->nodeValue = $text;
        }

        return $node;
}

It's easier to call $doc->createTextNode('body', 'Text of body') than to write four lines of code.

Andi

--
Martel Valgoerad aka Michal Minicki | [EMAIL PROTECTED] | 
http://aie.pl/martel.asc
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Idleness is not doing nothing. Idleness is being free to do anything." --
Floyd Dell

Reply via email to