>> 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
>> 
>> 
>
>DOMProcessingInstruction as such:
>
><?php
>error_reporting(E_ALL | E_STRICT);
>
>$doc = new DOMDocument();
>$doc->formatOutput = true;
>
>// processing instruction data
>$styleheetParams = 'href="xsl_table.xsl" type="text/xsl"';
>
>// create processing instruction
>$xmlstylesheet = new DOMProcessingInstruction( 'xml-stylesheet',
$styleheetParams);
>
>//append it to the doc
>$doc->appendChild($xmlstylesheet);
>
>$foo = $doc->createElement("foo");
>$doc->appendChild($foo);
>
>$bar = $doc->createElement("bar");
>$foo->appendChild($bar);
>
>$bazz = $doc->createElement("bazz");
>$foo->appendChild($bazz);
>
>echo $doc->saveXML();
>
>?>

Thanks Nathan,

That worked perfect!

Shanon



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

Reply via email to