Re: How about a saveXHTML for the DOM?
| From: | Michael A. Peters | Date: | Fri, 10 Apr 2009 20:03:49 +0000 |
| Subject: | Re: How about a saveXHTML for the DOM? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-291357@lists.php.net to get a copy of this message | ||
Michael A. Peters wrote:
$myxhtml->loadXML($xmlstring); $elements = $myxhtml->getElementsByTagName("html"); $xmlHtml = $elements->item(0); ?>forgot this tidbit - <?pjp if ($usexml == 1) { $xmlHtml->setAttribute("xmlns","http://www.w3.org/1999/xhtml"); $xmlHtml->setAttributeNS('http://www.w3.org/XML/1998/namespace','xml:lang','en'); } *now* you can have your php code populate the dom by appending children to $xmlHtml neutral to whether or not it eventually is going to be sent as xml or html.