I have the following code:

#!/usr/bin/php -q
<?PHP
error_reporting(E_ALL);
ini_set('display_errors', '1');
    $doc = new DOMDocument();
    $doc->formatOutput = true;

    $foo = $doc->createElement("foo");
    $doc->appendChild($foo);

    $bar = $doc->createElement("bar");
    $foo->appendChild($bar);

    $bazz = $doc->createElement("bazz");
    $foo->appendChild($bazz);

    echo $doc->saveXML();

?>

Which generates:

<?xml version="1.0"?>
<foo>
  <bar/>
  <bazz/>
</foo>

Is there a way to make it create the following XML?

<?xml version="1.0"?>
<?xml-stylesheet href="xsl_table.xsl" type="text/xsl"?>
<foo>
  <bar/>
  <bazz/>
</foo>

I can't seem to find any dom functions to do this.

Thanks in advance,
Shanon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to