note that
string DomDocument->
create_processing_instruction ( string contenido)
takes two arguments:
- first: the processing instruction,
- second: the arguments and values of
the processing instruction
:::so must be:
string DomDocument->
create_processing_instruction ( string prInst,
string contenido)
DomDocument::create_processing_instruction
(PHP 4 >= 4.1.0)
DomDocument::create_processing_instruction — Yeni bir işlem komutu düğümü oluşturur
Açıklama
Belirtilen içeriği kullanarak yeni bir işlem komutu düğümü oluşturur. Bu düğüm, DomNode::append_child gibi bir yöntemle belgeye yerleştirilmedikçe belgede gösterilmez.
Dönen Değerler
Bir hata oluşursa FALSE yoksa bir DomProcessingInstruction nesnesi döndürür.
Ayrıca Bakınız
- DomNode::append_child - Düğüme en küçük çocuk olarak bir çocuk ekler
- DomDocument::create_element - Yeni bir eleman düğümü oluşturur
- DomDocument::create_cdata_section - Yeni bir CDATA düğümü oluşturur
- DomDocument::create_comment - Yeni bir açıklama düğümü oluşturur
- DomDocument::create_text_node - Yeni bir metin düğümü oluşturur
- DomDocument::create_attribute - Yeni bir öznitelik düğümü oluşturur
- DomDocument::create_entity_reference - Yeni bir öğe gönderimi oluşturur
- DomNode::insert_before - Düğümün öncesine yeni bir düğüm yerleştirir
DomDocument::create_processing_instruction
fru at not dot spam dot com
03-Aug-2004 09:31
03-Aug-2004 09:31
AlanCanon
26-May-2004 09:20
26-May-2004 09:20
There's an error in both the above examples: it's "xml-stylesheet," not "xsl-stylesheet.Corrected examples:
$pi = $dom->create_processing_instruction
(
"xml-stylesheet",
"type=\"text/xsl\" href=\"$stylesheet\""
);
$dom->append_child($pi);
apoco at cox dot net
02-Dec-2003 04:34
02-Dec-2003 04:34
That prior user example creates an invalid processing insruction under 4.3.4. The first parameter is the processing instruction, and the second can be used for the attributes of the PI. Here's a code snippet I used to insert a stylesheet:
<?php
$pi = $doc->create_processing_instruction(
"xsl-stylesheet",
"type=\"text/xsl\" href=\"$stylesheet\"");
$doc->append_child($pi);
?>
rj.kamp at hccnet dot nl
20-Oct-2003 11:29
20-Oct-2003 11:29
Please note that you have to use this function the following way to add a stylsheetr for client side processing.
$pi = $myDoc->create_processing_instruction('','xsl-stylesheet type="text/xsl" href="path_to_my_stylesheet"');
$myDoc->append_child($pi);
And note you have to add this to the document before the rootnode.
