reference/dom/domelement/setattributenodens.xml
b984d18e783b295fa78bd8a8a3e673311c5be65e
...
...
@@ -1,18 +1,19 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xml:id='domelement.setattributenodens' xmlns="http://docbook.org/ns/docbook">
3
+
<refentry xml:id="domelement.setattributenodens" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>DOMElement::setAttributeNodeNS</refname>
6
6
<refpurpose>Adds new attribute node to element</refpurpose>
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
-
<methodsynopsis>
11
-
<modifier>public</modifier> <type>DOMAttr</type><methodname>DOMElement::setAttributeNodeNS</methodname>
10
+
<methodsynopsis role="DOMElement">
11
+
<modifier>public</modifier> <type class="union"><type>DOMAttr</type><type>null</type><type>false</type></type><methodname>DOMElement::setAttributeNodeNS</methodname>
12
12
<methodparam><type>DOMAttr</type><parameter>attr</parameter></methodparam>
13
13
</methodsynopsis>
14
14
<para>
15
-
Adds new attribute node <parameter>attr</parameter> to element.
15
+
Adds new attribute node <parameter>attr</parameter> to element, keeping the namespace into account.
16
+
If an attribute with the same name already exists on the element, that attribute is replaced by <parameter>attr</parameter>.
16
17
</para>
17
18
</refsect1>
18
19
<refsect1 role="parameters">
...
...
@@ -33,7 +34,8 @@
33
34
<refsect1 role="returnvalues">
34
35
&reftitle.returnvalues;
35
36
<para>
36
-
Returns the old node if the attribute has been replaced.
37
+
Returns the old attribute if it has been replaced or &null; if there was no old attribute.
38
+
If a <constant>DOM_WRONG_DOCUMENT_ERR</constant> error is raised, and <varname linkend="domdocument.props.stricterrorchecking">strictErrorChecking</varname> is &false;, &false; is returned.
37
39
</para>
38
40
</refsect1>
39
41
<refsect1 role="errors">
...
...
@@ -41,10 +43,10 @@
41
43
<para>
42
44
<variablelist>
43
45
<varlistentry>
44
-
<term><constant>DOM_NO_MODIFICATION_ALLOWED_ERR</constant></term>
46
+
<term><constant>DOM_WRONG_DOCUMENT_ERR</constant></term>
45
47
<listitem>
46
48
<para>
47
-
Raised if the node is readonly.
49
+
Raised if <parameter>attr</parameter> belongs to a different document than the element.
48
50
</para>
49
51
</listitem>
50
52
</varlistentry>
...
...
@@ -62,7 +64,6 @@
62
64
</para>
63
65
</refsect1>
64
66
</refentry>
65
-

66
67
<!-- Keep this comment at the end of the file
67
68
Local variables:
68
69
mode: sgml
69
70