mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
upgrade example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@281866 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e65155b6c6
commit
4311c96437
1 changed files with 13 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry xml:id='domattr.construct' xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>DOMAttr::__construct</refname>
|
||||
|
@ -14,8 +14,9 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
Creates a new DOMAttr object. This object is read only.
|
||||
It may be appended to a document, but additional nodes may not be appended to this node until
|
||||
the node is associated with a document. To create a writable node, use
|
||||
It may be appended to a document, but additional nodes may
|
||||
not be appended to this node until the node is associated
|
||||
with a document. To create a writable node, use
|
||||
<xref linkend="domdocument.createattribute" />.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -46,7 +47,7 @@
|
|||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Creating a new DOMAttr</title>
|
||||
<title>Creating a new <classname>DOMAttr</classname> object</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -54,11 +55,18 @@
|
|||
$dom = new DOMDocument('1.0', 'iso-8859-1');
|
||||
$element = $dom->appendChild(new DOMElement('root'));
|
||||
$attr = $element->setAttributeNode(new DOMAttr('attr', 'attrvalue'));
|
||||
echo $dom->saveXML(); /* <?xml version="1.0" encoding="iso-8859-1"?><root attr="attrvalue" /> */
|
||||
echo $dom->saveXML();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<root attr="attrvalue" />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
Loading…
Reference in a new issue