PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

DomDocument->create_text_node> <DomDocument->create_entity_reference
Last updated: Fri, 10 Oct 2008

view this page in

DomDocument->create_processing_instruction

(No version information available, might be only in CVS)

DomDocument->create_processing_instruction新規 PI ノードを作成する

説明

domprocessinginstruction DomDocument->create_processing_instruction ( string $content )

この関数は DomCData クラスの新規インスタンスを返します。 PI の内容は渡されたパラメータの値です。このノードは、(たとえば) domnode_append_child() などで挿入されない限り、ドキュメント内に現われません。

エラーが発生した場合、戻り値は FALSE です。

domnode_append_child(), domdocument_create_element(), domdocument_create_text(), domdocument_create_cdata_section(), domdocument_create_attribute(), domdocument_create_entity_reference(), domnode_insert_before() も参照ください。



add a note add a note User Contributed Notes
DomDocument->create_processing_instruction
fru at not dot spam dot com
03-Aug-2004 11:31
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)
AlanCanon
26-May-2004 11: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 05: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
21-Oct-2003 01: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.

 
show source | credits | sitemap | contact | advertising | mirror sites