Parses an XML string. Throws an error if the XML is incorrect.
XML
Wraps XML into an object.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| static | Boolean = true | read/write | Controls whether XML comments should be parsed (false) or ignored (true). |
| static | Boolean = true | read/write | Controls whether XML preprocessing instructions should be parsed (false) or ignored (true). |
| static | Boolean = true | read/write | Controls whether whitespace should be parsed (false) or ignored (true). |
| static | Number = 2 | read/write | The number of spaces used to indent pretty-printed XML. |
| static | Boolean = true | read/write | When true, XML is pretty-printed when converting to a string. |
Methods
Adds a namespace declaration to the node. Returns the XML object itself.
Appends the given XML to this XML as a child. Returns the XML object itself.
Returns a list containing all attribute elements matching the given name.
Returns a list containing all attribute elements.
Returns a list containing all children of this XML matching the given element name.
Returns a number representing the ordinal position of this XML object within the context of its parent.
Returns an XML object containing all the properties of this XML object in order.
Returns an XML object containing the properties of this XML object that represent XML comments.
Checks if this XML object contains the given XML object.
Creates a copy of this XML object.
Returns an object containing the default parsing and print settings for XML.
Returns all the XML-valued descendants of this XML object with the given name.
Returns a list of XML children that are elements with a given name, or all children that are XML elements.
Reports whether this XML object contains complex content.
Reports whether this XML object contains simple content.
Returns an array of Namespace objects mirroring the current list of valid namespaces at this element.
Inserts the given child2 after the given child1 in this XML object and returns this XML object.
Inserts the given child2 before the given child1 in this XML object and returns this XML object.
Returns the number of elements contained in an XML list. If this XML object is not a list, returns 1.
Returns the local name of this XML object.
Returns a QName object containing the URI and the local name of the element.
Returns a Namespace object containing the namespace URI of the current element.
Returns an array containing all namespace declarations of this XML object.
Returns the type of this XML object as one of the strings "element", "attribute", "comment", "processing-instruction", or "text".
Puts all text nodes in this and all descendant XML objects into a normal form by merging adjacent text nodes and eliminating empty text nodes. Returns this XML object.
Returns the parent object of this XML object.
Inserts a given child into this object before its existing XML properties, and returns this XML object.
Returns a list of preprocessing instructions.
Removes the given namespace from this XML, and returns this XML.
Replaces the value of specified XML properties of this XML object returns this XML object.
Replaces all of the XML-valued properties in this object with a new value, and returns this XML object.
Replaces the local name of this XML object with a string constructed from the given name
Replaces the name of this XML object with the given QName object.
Sets the namespace for this XML element.
Sets the parsing and print setting for XML using an object returned by the settings() method.
Returns an object containing the current parsing and print settings for XML.
Returns an XML list containing all XML properties of this XML object that represent XML text nodes.
Returns the string representation of this object.
Returns an XML-encoded string representation of this XML object.
Evaluates the given XPath expression in accordance with the W3C XPath recommendation, using this XML object as the context node.
Parameter of 7
Method parameters that accept a XML.
Return 21
Methods that return a XML.