Re: [PHP-XML-DEV] DomDocument, insert HTML Element

[email protected] (Martel Valgoerad) Fri, 12 Nov 2004 12:11:29 +0100
Newsgroups php.xml.dev
Message-ID <[email protected]>
Rob Richards wrote:

First of all, thanks for prompt reply.

> Wrong list as this list is for development of the xml extensions not support
> for them.

What would be the right place to post? The reason I'm asking is because I
would like to subscribe and I don't know where (but I would rather skip the
high volume general lists since I'm looking for PHP 5 XML/XSLT support only). 

> Anways, with php 5.1 you use the new appendXML method of DOMFragement
> object:
> 
> $HTML = 'Some kind of <a href="http://cos.com">HTML</a>';
> $bodyfrag = $doc->createDocumentFragment();
> $bodyfrag->appendXML($HTML);
> $body = $doc->createElement('body');
> $body->appendChild($bodyfrag);
> $art->appendChild($body);

Fatal error: Call to undefined method DOMDocumentFragment::appendXML()
in /var/www/aiev4/webapp/modules/default/views/testSuccessView.class.php on
line 18

I guess it's CVS only, right? Since there is no PHP 5.1 on the download page.
Guess I'll have to wait a bit :)

I'm using PHP 5.0.2, btw. I found the DocumentFragment in the DOM Refrence on
w3c (and I was trying to use it) but the DomFragment is undocumented on the
PHP docs: http://pl.php.net/manual/en/ref.dom.php

Is there any place where I can find the documentation for DocumentFragment or
even attributes of DomDocument like resolveExternals or substituteEntities?

> In your example you are trying to used mixed content for the contents of an
> element which is bad.

I'm using XML + XSLT as a templating engine. In this particular case I'm
dealing with form user input which accepts HTML (and then is stored in a
database). What approach would you recommend? Of course, if it's not too bold
to ask given this thread is highly off-topic.

> Rob

-- 
Martel Valgoerad   (a.k.a. Michal Minicki) | "I am not young enough to know
alea.iacta.est | Martel --> [email protected] | everything." Oscar Wilde
Web Page:                http://www.aie.pl |