PHP Conference Nagoya 2025

DOMElement::setAttributeNodeNS

(PHP 5, PHP 7, PHP 8)

DOMElement::setAttributeNodeNSAdds new attribute node to element

Descrizione

public DOMElement::setAttributeNodeNS(DOMAttr $attr): DOMAttr|null|false

Adds new attribute node attr to element, keeping the namespace into account. If an attribute with the same name already exists on the element, that attribute is replaced by attr.

Elenco dei parametri

attr

The attribute node.

Valori restituiti

Returns the old attribute if it has been replaced or null if there was no old attribute. If a DOM_WRONG_DOCUMENT_ERR error is raised, and strictErrorChecking is false, false is returned.

Errori/Eccezioni

DOM_WRONG_DOCUMENT_ERR

Raised if attr belongs to a different document than the element.

Vedere anche:

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top