Class XMLDocument

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

    public class XMLDocument
    extends Document
    A JavaScript object for XMLDocument.
    See Also:
    Serialized Form
    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
    • Constructor Detail

      • XMLDocument

        public XMLDocument()
        Creates a new instance.
      • XMLDocument

        public XMLDocument​(WebWindow enclosingWindow)
        Creates a new instance, with associated XmlPage.
        Parameters:
        enclosingWindow - the window
    • Method Detail

      • jsConstructor

        public void jsConstructor()
        JavaScript constructor.
        Overrides:
        jsConstructor in class Document
      • loadXML

        public boolean loadXML​(java.lang.String strXML)
        Loads an XML document using the supplied string.
        Parameters:
        strXML - A string containing the XML string to load into this XML document object This string can contain an entire XML document or a well-formed fragment.
        Returns:
        true if the load succeeded; false if the load failed
      • createParserErrorXmlPage

        private static XmlPage createParserErrorXmlPage​(java.lang.String message,
                                                        WebWindow webWindow)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • makeScriptableFor

        public HtmlUnitScriptable makeScriptableFor​(DomNode domNode)
        Builds a new the JavaScript object that corresponds to the specified object.
        Overrides:
        makeScriptableFor in class HtmlUnitScriptable
        Parameters:
        domNode - the DOM node for which a JS object should be created
        Returns:
        the JavaScript object
      • initParentScope

        protected void initParentScope​(DomNode domNode,
                                       HtmlUnitScriptable scriptable)
        Initialize the parent scope of a newly created scriptable.
        Overrides:
        initParentScope in class HtmlUnitScriptable
        Parameters:
        domNode - the DOM node for the script object
        scriptable - the script object to initialize
      • getElementsByTagName

        public HTMLCollection getElementsByTagName​(java.lang.String tagName)
        Returns all the descendant elements with the specified tag name.
        Overrides:
        getElementsByTagName in class Document
        Parameters:
        tagName - the name to search for
        Returns:
        all the descendant elements with the specified tag name