mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Add example how to add nested children.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@343366 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
904d0aeccd
commit
55697d5c8e
1 changed files with 24 additions and 0 deletions
|
@ -77,6 +77,7 @@
|
|||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -92,6 +93,28 @@ $doc = new DOMDocument;
|
|||
$node = $doc->createElement("para");
|
||||
$newnode = $doc->appendChild($node);
|
||||
|
||||
echo $doc->saveXML();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title>Nested children</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$doc = new DOMDocument;
|
||||
|
||||
$headNode = $doc->createElement("head");
|
||||
$doc->appendChild($headNode);
|
||||
|
||||
$titleNode = $doc->createElement("title");
|
||||
$headNode->appendChild($titleNode);
|
||||
|
||||
echo $doc->saveXML();
|
||||
?>
|
||||
]]>
|
||||
|
@ -99,6 +122,7 @@ echo $doc->saveXML();
|
|||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue