Name
createAttribute: name
Synopsis
This function creates an Attr
object with the given name.
Attr
nodes construct complex
element attributes that can include EntityReference
objects and text
data.
Argument
- name: DOMString
The name of the XML attribute.
Return value
The new Attr
object.
Exception
- INVALID_CHARACTER_ERR
Indicates that the name you passed to
createAttribute( )
is not a valid XML name. See Chapter 2 for the XML restrictions on name construction.
Java binding
public Node adoptNode(Node source) throws DOMException;
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.