Re: How to Insert <?xml-stylesheet .....?> into DOMDocument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shanon Swafford schrieb:
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


Hi Shanon,
please look at the Class itself, if you can modify the Header of the XML data over a method/Constant.

Greetings

Carlos Medina

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux