.. _XML: ================================================ XML ================================================ Description ----------- Wraps XML into an object. Static Properties ^^^^^^^^^^^^^^^^^ +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`ignoreComments` readonly | Controls whether XML comments should be parsed (false) or ignored (true). | +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`ignoreProcessingInstructions` readonly | Controls whether XML preprocessing instructions should be parsed (false) or ignored (true). | +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`ignoreWhitespace` readonly | Controls whether whitespace should be parsed (false) or ignored (true). | +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`prettyIndent` readonly | The number of spaces used to indent pretty-printed XML. | +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`prettyPrinting` readonly | When true, XML is pretty-printed when converting to a string. | +--------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ Constructors ^^^^^^^^^^^^ +------------------------------+----------------------------------------------------------------+ | :ref:`XML` readonly | Parses an XML string. Throws an error if the XML is incorrect. | +------------------------------+----------------------------------------------------------------+ Methods ^^^^^^^ +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`addNamespace` readonly | Adds a namespace declaration to the node. Returns the XML object itself. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`appendChild` readonly | Appends the given XML to this XML as a child. Returns the XML object itself. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`attribute` readonly | Returns a list containing all attribute elements matching the given name. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`attributes` readonly | Returns a list containing all attribute elements. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`child` readonly | Returns a list containing all children of this XML matching the given element name. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`childIndex` readonly | Returns a number representing the ordinal position of this XML object within the context of its parent. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`children` readonly | Returns an XML object containing all the properties of this XML object in order. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`comments` readonly | Returns an XML object containing the properties of this XML object that represent XML comments. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`contains` readonly | Checks if this XML object contains the given XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`copy` readonly | Creates a copy of this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`descendants` readonly | Returns all the XML-valued descendants of this XML object with the given name. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`elements` readonly | Returns a list of XML children that are elements with a given name, or all children that are XML elements. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`hasComplexContent` readonly | Reports whether this XML object contains complex content. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`hasSimpleContent` readonly | Reports whether this XML object contains simple content. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`inScopeNamespaces` readonly | Returns an array of Namespace objects mirroring the current list of valid namespaces at this element. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`insertChildAfter` readonly | Inserts the given child2 after the given child1 in this XML object and returns this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`insertChildBefore` readonly | Inserts the given child2 before the given child1 in this XML object and returns this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`length` readonly | Returns the number of elements contained in an XML list. If this XML object is not a list, returns 1. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`localName` readonly | Returns the local name of this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`name` readonly | Returns a QName object containing the URI and the local name of the element. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`namespace` readonly | Returns a Namespace object containing the namespace URI of the current element. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`namespaceDeclarations` readonly | Returns an array containing all namespace declarations of this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`nodeKind` readonly | Returns the type of this XML object as one of the strings "element", "attribute", "comment", "processing-instruction", or "text". | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`normalize` readonly | 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. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`parent` readonly | Returns the parent object of this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`prependChild` readonly | Inserts a given child into this object before its existing XML properties, and returns this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`processingInstructions` readonly | Returns a list of preprocessing instructions. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`removeNamespace` readonly | Removes the given namespace from this XML, and returns this XML. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`replace` readonly | Replaces the value of specified XML properties of this XML object returns this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setChildren` readonly | Replaces all of the XML-valued properties in this object with a new value, and returns this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setLocalName` readonly | Replaces the local name of this XML object with a string constructed from the given name | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setName` readonly | Replaces the name of this XML object with the given QName object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setNamespace` readonly | Sets the namespace for this XML element. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`text` readonly | Returns an XML list containing all XML properties of this XML object that represent XML text nodes. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toString` readonly | Returns the string representation of this object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toXMLString` readonly | Returns an XML-encoded string representation of this XML object. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`xpath` readonly | Evaluates the given XPath expression in accordance with the W3C XPath recommendation, using this XML object as the context node. | +--------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Static Methods ^^^^^^^^^^^^^^ +------------------------------------------------------+-----------------------------------------------------------------------------------------------+ | :ref:`defaultSettings` readonly | Returns an object containing the default parsing and print settings for XML. | +------------------------------------------------------+-----------------------------------------------------------------------------------------------+ | :ref:`setSettings` readonly | Sets the parsing and print setting for XML using an object returned by the settings() method. | +------------------------------------------------------+-----------------------------------------------------------------------------------------------+ | :ref:`settings` readonly | Returns an object containing the current parsing and print settings for XML. | +------------------------------------------------------+-----------------------------------------------------------------------------------------------+ .. container:: hide .. toctree:: :hidden: :maxdepth: 1 XML/ignoreComments.rst XML/ignoreProcessingInstructions.rst XML/ignoreWhitespace.rst XML/prettyPrinting.rst XML/prettyIndent.rst XML/addNamespace.rst XML/appendChild.rst XML/attribute.rst XML/attributes.rst XML/child.rst XML/childIndex.rst XML/children.rst XML/comments.rst XML/contains.rst XML/copy.rst XML/descendants.rst XML/elements.rst XML/hasComplexContent.rst XML/hasSimpleContent.rst XML/inScopeNamespaces.rst XML/insertChildAfter.rst XML/insertChildBefore.rst XML/length.rst XML/localName.rst XML/name.rst XML/namespace.rst XML/namespaceDeclarations.rst XML/nodeKind.rst XML/normalize.rst XML/parent.rst XML/processingInstructions.rst XML/prependChild.rst XML/removeNamespace.rst XML/replace.rst XML/setChildren.rst XML/setLocalName.rst XML/setName.rst XML/setNamespace.rst XML/text.rst XML/toString.rst XML/toXMLString.rst XML/xpath.rst XML/settings.rst XML/setSettings.rst XML/defaultSettings.rst XML/XML.rst