
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 248
XML object functions
addNamespace()
xmlObj.addNamespace (ns);
ns
A Namespace object.
Adds a namespace declaration to this node.
Returns this XML object
.
appendChild()
xmlObj.appendChild (child);
child
An XML object or any value that can be converted to a String with toString().
Appends a child element to this node, after any existing children. If the argument is not XML,
creates a new XML element that contains the string as its text value, using the same element name
as the last element currently contained in this object’s node.
Returns this XML object
.
attributes()
xmlObj.attributes (name);
name
A String, the attribute name.
Retrieves a list of the named attribute elements contained in this node.
Returns an XML object
containing all values of the named attribute.
child()
xmlObj.child (which);
which
A String, the element name, or a Number, a 0-based index into this node’s child array.
Retrieves a list of all child elements of this node of a given type.
Returns an XML object
containing all child elements of the given type.
childIndex()
xmlObj.childIndex ();
Retrieves the 0-based position index of this node within its parent node.
Returns a Number.
children()
xmlObj.children();
Retrieves all of the immediate child elements of this node, including text elements.
Returns an XML object
containing the child elements.
comments()
xmlObj.comments();
Retrieves all XML comment elements from this node.
Returns an XML object
containing the comments.
Comentários a estes Manuais