Re: xml encodeing with new_xmldoc("1.0");
| From: | Tom Rogers | Date: | Tue, 01 Oct 2002 01:00:23 +0000 |
| Subject: | Re: xml encodeing with new_xmldoc("1.0"); | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118281@lists.php.net to get a copy of this message | ||
Hi,
Monday, September 30, 2002, 10:54:25 PM, you wrote:
DÖJ> I need to apply iso-8859-1 encodeing to the <?xml version=1.0?> that
DÖJ> this function creates:
DÖJ> new_xmldoc(1.0).
DÖJ> I tried to replace the line but ofcourse the new_xmldoc function creates
DÖJ> object-tree of the document and I dont know I can reffrer to
DÖJ> the first line, or <?xml version=1.0?> or just create the document
DÖJ> with the encodeing
DÖJ> Thanks, David
One way to force it:
<?
ob_start();
echo '<?xml version="1.0" encoding="iso-8859-1"?><root/>';
$buffer = ob_get_contents();
ob_end_clean();
$dom = domxml_open_mem($buffer);
echo '<pre>';
echo htmlentities($dom->dump_mem(true));
echo '</pre>';
?>
When it saves the document it should then convert to iso-8859-1
Just make '<root/>' whatever the root element will be.
--
regards,
Tom