Re: domxml and setting the DOCTYPE
| From: | Tom Rogers | Date: | Wed, 25 Sep 2002 03:42:31 +0000 |
| Subject: | Re: domxml and setting the DOCTYPE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117495@lists.php.net to get a copy of this message | ||
Hi,
Tuesday, September 24, 2002, 7:22:24 PM, you wrote:
RB> Hi,
RB> I'm generating XML files with the domxml functions. Everything works fine,
RB> but I can't set the <!DOCTYPE blah SYSTEM "my.dtd">.
RB> I tried to add a textnode, but <>" are translate in < > "
RB> :(
RB> Thanks for your help.
RB> Raph
RB> PS:Having some troubles to send on the ML, I send this through the news
RB> server (excuse if you get my request two times)
One way to cheat :)
<?
ob_start();
echo '<?xml version="1.0"?>'
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<root />
<?
$buffer = ob_get_contents();
ob_end_clean();
$dom = domxml_open_mem($buffer);
$doctype = $dom->doctype();
echo '<pre>';
print_r($doctype);
echo htmlentities($dom->dump_mem(true));
echo '</pre>';
--
regards,
Tom