php-doc-en/reference/domxml/functions/DomNode-add-namespace.xml
2005-06-13 10:03:08 +00:00

103 lines
2.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<refentry id='function.domnode-add-namespace'>
<refnamediv>
<refname>DomNode->add_namespace</refname>
<refpurpose>
Adds a namespace declaration to a node
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>DOMNode</classname></ooclass>
<methodsynopsis>
<type>bool</type><methodname>add_namespace</methodname>
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
<methodparam><type>string</type><parameter>prefix</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
This method adds a namespace declaration to a node.
</para>
<note>
<para>
This method is not part of the DOM specification.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>uri</parameter></term>
<listitem>
<para>
The namespace URI of the node.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>prefix</parameter></term>
<listitem>
<para>
The namespace prefix of the node.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="migration">
<title>Migrating to PHP 5</title>
<para>
You can set the namespace URI and prefix of a <classname>DOMElement</classname>
or a <classname>DOMAttr</classname> at creation time by using
<xref linkend='function.dom-domdocument-createelementns' /> or
<xref linkend='function.dom-domdocument-createattributens' />.
</para>
<note>
<para>
Remember the an attribute does not inherit its namespace from the element
it is attached to.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><xref linkend="function.domdocument-create-element-ns" /></member>
<member><xref linkend="function.domnode-set-namespace" /></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->