note 64268 added to function.domdocument-create-processing-instruction
| From: | php-general at lists dot php dot net | Date: | Tue, 11 Apr 2006 08:26:48 +0000 |
| Subject: | note 64268 added to function.domdocument-create-processing-instruction | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107743@lists.php.net to get a copy of this message | ||
i,m creating an xml document using php, i want include a xsl style sheet in the code.
all i need is to add this line so it can be associated with the style sheet
<?xml-stylesheet type="text/xsl" href="stylesheetname.xsl"?>
here is the code:
$doc = new_xmldoc('1.0');
$pi = $doc->create_processing_instruction(
"xsl-stylesheet",
"type=\"text/xsl\" href=\"$stylesheet\"");
$doc->append_child($pi);
can someone please verify
$root = $doc->add_root('rows');
$member = $root->new_child('wes_ica2','');
$member->new_child('id','John');
$member->new_child('county_UA','Adams');
$member->new_child('pop_code','3400');
$member->new_child('favourite_instrument','Debra');
$member = $root->new_child('wes_ica7','');
$member->new_child('id','Hones');
$member->new_child('fruit','2400');
$member->new_child('prizes','Jake');
$member->new_child('fguk_code','Tudor');
$member->new_child('fgeu_code','1200');
$fp = @fopen('beep.xml','w');
if(!$fp) {
die('Error XML file not Updated');
}
fwrite($fp,$doc->dumpmem());
fclose($fp);
----
Server IP: 216.194.113.175
Probable Submitter: 62.254.64.18 (proxied: 82.16.85.176)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.domdocument-create-processing-instruction.php
Edit -- http://master.php.net/note/edit/64268
Del: integrated -- http://master.php.net/note/delete/64268/integrated
Del: useless -- http://master.php.net/note/delete/64268/useless
Del: bad code -- http://master.php.net/note/delete/64268/bad+code
Del: spam -- http://master.php.net/note/delete/64268/spam
Del: non-english -- http://master.php.net/note/delete/64268/non-english
Del: in docs -- http://master.php.net/note/delete/64268/in+docs
Del: other reasons-- http://master.php.net/note/delete/64268
Reject -- http://master.php.net/note/reject/64268
Search -- http://master.php.net/manage/user-notes.php