
CHAPTER 9: Integrating XML into JavaScript XML Object Reference 253
setNamespace()
xmlObj.setNamespace(ns);
ns
A Namespace object for a namespace that has been declared in the tree above this
element.
Sets the namespace for this XML element. If the namespace has not been declared in the tree above
this element, add a namespace declaration instead.
Returns this XML object
.
text()
xmlObj.text();
Retrieves text nodes from this element.
Returns an XML object
containing all properties of this object that represent XML text nodes.
toString()
xmlObj.toString();
Creates a string representation of this object.
X For text and attribute nodes, this is the textual value of the node.
X For other elements, it is the result of toXMLString().
X If this XML object is a list, concatenates the result of calling the function on each contained
element.
Returns a String.
toXMLString()
xmlObj.toXMLString();
Creates an XML-encoded string representation of this XML object. This result includes the start tag,
attributes and end tag of the XML object, regardless of its content. Formats the string as specified
by the global settings
XML.prettyPrinting and XML.prettyIndent.
Returns a String.
Comentarios a estos manuales