Class XMLDocument

All Implemented Interfaces:
Serializable, 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:
  • Field Details

    • LOG

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

    • XMLDocument

      public XMLDocument()
      Creates a new instance.
    • XMLDocument

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

    • jsConstructor

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

      public boolean loadXML(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(String message, WebWindow webWindow) throws IOException
      Throws:
      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(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