Package org.htmlunit.xml

# Class XmlPage

java.lang.Object
org.htmlunit.html.DomNode
org.htmlunit.SgmlPage
org.htmlunit.xml.XmlPage

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Page`, `Document`, `Node`

public class XmlPage extends SgmlPage
A page that will be returned for response with content type "text/xml".

See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.htmlunit.html.DomNode

  `DomNode.ChildIterator, DomNode.DescendantDomElementsIterator, DomNode.DescendantDomNodesIterator, DomNode.DescendantElementsIterator<T extends DomNode>, DomNode.DescendantHtmlElementsIterator`

- ## Field Summary

  ### Fields inherited from class org.htmlunit.html.DomNode

  `PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED`

  ### Fields inherited from interface org.w3c.dom.Node

  `ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XmlPage(WebResponse webResponse, WebWindow enclosingWindow)`
  Creates an instance.
  `XmlPage(WebResponse webResponse, WebWindow enclosingWindow, boolean ignoreSAXException)`
  Creates an instance.
  `XmlPage(WebResponse webResponse, WebWindow enclosingWindow, boolean ignoreSAXException, boolean handleXHTMLAsHTML)`
  Creates an instance.
  `XmlPage(Node node, WebWindow enclosingWindow)`
  Creates an instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Node`
  `adoptNode(Node source)`
  Not yet implemented.
  `Attr`
  `createAttributeNS(String namespaceURI, String qualifiedName)`
  Not yet implemented.
  `DomElement`
  `createElement(String tagName)`
  `DomElement`
  `createElementNS(String namespaceURI, String qualifiedName)`
  `EntityReference`
  `createEntityReference(String name)`
  Not yet implemented.
  `DomProcessingInstruction`
  `createProcessingInstruction(String target, String data)`
  `Charset`
  `getCharset()`
  Returns the encoding.
  `String`
  `getContentType()`
  Returns the content type of this page.
  `String`
  `getDocumentURI()`
  Not yet implemented.
  `DOMConfiguration`
  `getDomConfig()`
  Not yet implemented.
  `Element`
  `getElementById(String elementId)`
  Not yet implemented.
  `DOMImplementation`
  `getImplementation()`
  Not yet implemented.
  `String`
  `getInputEncoding()`
  Not yet implemented.
  `boolean`
  `getStrictErrorChecking()`
  Not yet implemented.
  `Document`
  `getXmlDocument()`
  Returns the DOM representation of the XML content.
  `String`
  `getXmlEncoding()`
  `boolean`
  `getXmlStandalone()`
  `String`
  `getXmlVersion()`
  `boolean`
  `hasCaseSensitiveTagNames()`
  Returns `true` if this page has case-sensitive tag names, `false` otherwise.
  `Node`
  `importNode(Node importedNode, boolean deep)`
  Not yet implemented.
  `void`
  `initialize()`
  Initialize this page.
  `Node`
  `renameNode(Node n, String namespaceURI, String qualifiedName)`
  Not yet implemented.
  `void`
  `setDocumentType(DocumentType type)`
  Sets the document type.
  `void`
  `setDocumentURI(String documentURI)`
  Not yet implemented.
  `void`
  `setNodeValue(String value)`
  `void`
  `setPrefix(String prefix)`
  `void`
  `setStrictErrorChecking(boolean strictErrorChecking)`
  Not yet implemented.
  `void`
  `setXmlStandalone(boolean xmlStandalone)`
  Not yet implemented.
  `void`
  `setXmlVersion(String xmlVersion)`
  Not yet implemented.

  ### Methods inherited from class org.htmlunit.SgmlPage

  `asXml, characterDataChangeListenerAdded, cleanUp, clearComputedStyles, clearComputedStyles, clearComputedStylesUpToRoot, clone, createAttribute, createCDATASection, createComment, createDocumentFragment, createNodeIterator, createTextNode, domChangeListenerAdded, getCanonicalXPath, getDoctype, getDocumentElement, getElementsByTagName, getElementsByTagNameNS, getEnclosingWindow, getNodeName, getNodeType, getPage, getUrl, getWebClient, getWebResponse, isCharacterDataChangeListenerInUse, isDomChangeListenerInUse, isHtmlPage, isPrinting, normalizeDocument, setEnclosingWindow, setPrinting`

  ### Methods inherited from class org.htmlunit.html.DomNode

  `addCharacterDataChangeListener, addDomChangeListener, appendChild, asNormalizedText, basicRemove, checkChildHierarchy, cloneNode, closest, compareDocumentPosition, detach, fireCharacterDataChanged, fireNodeAdded, fireNodeDeleted, getAncestors, getAttributes, getBaseURI, getByXPath, getByXPath, getChildNodes, getChildren, getDescendants, getDomElementDescendants, getEndColumnNumber, getEndLineNumber, getFeature, getFirstByXPath, getFirstByXPath, getFirstChild, getHtmlElementDescendants, getHtmlPageOrNull, getIndex, getLastChild, getLocalName, getNamespaceURI, getNextElementSibling, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousElementSibling, getPreviousSibling, getReadyState, getScriptableObject, getSelectorList, getStartColumnNumber, getStartLineNumber, getTextContent, getUserData, getVisibleText, handles, hasAttributes, hasChildNodes, hasFeature, insertBefore, insertBefore, isAncestorOf, isAncestorOfAny, isAttachedToPage, isDefaultNamespace, isDisplayed, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, mayBeDisplayed, normalize, notifyIncorrectness, onAddedToDocumentFragment, onAddedToPage, onAllChildrenAddedToPage, parseHtmlSnippet, printChildrenAsXml, printXml, processImportNode, querySelector, querySelectorAll, quietlyRemoveAndMoveChildrenTo, remove, removeAllChildren, removeCharacterDataChangeListener, removeChild, removeDomChangeListener, replace, replaceChild, setEndLocation, setParentNode, setReadyState, setScriptableObject, setStartLocation, setTextContent, setUserData`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.w3c.dom.Node

  `appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setTextContent, setUserData`

- ## Constructor Details

  - ### XmlPage

    public XmlPage(WebResponse webResponse, WebWindow enclosingWindow) throws IOException
    Creates an instance. A warning is logged if an exception is thrown while parsing the XML content (for instance when the content is not a valid XML and can't be parsed).
    Parameters:
      `webResponse` - the response from the server
      `enclosingWindow` - the window that holds the page
    Throws:
      `IOException` - if the page could not be created

  - ### XmlPage

    public XmlPage(Node node, WebWindow enclosingWindow)
    Creates an instance. A warning is logged if an exception is thrown while parsing the XML content (for instance when the content is not a valid XML and can't be parsed).
    Parameters:
      `node` - the node to initialize this page with
      `enclosingWindow` - the window that holds the page

  - ### XmlPage

    public XmlPage(WebResponse webResponse, WebWindow enclosingWindow, boolean ignoreSAXException) throws IOException
    Creates an instance. A warning is logged if an exception is thrown while parsing the XML content (for instance when the content is not a valid XML and can't be parsed).
    Parameters:
      `webResponse` - the response from the server
      `enclosingWindow` - the window that holds the page
      `ignoreSAXException` - Whether to ignore `SAXException` or throw it as `IOException`
    Throws:
      `IOException` - if the page could not be created

  - ### XmlPage

    public XmlPage(WebResponse webResponse, WebWindow enclosingWindow, boolean ignoreSAXException, boolean handleXHTMLAsHTML) throws IOException
    Creates an instance. A warning is logged if an exception is thrown while parsing the XML content (for instance when the content is not a valid XML and can't be parsed).
    Parameters:
      `webResponse` - the response from the server
      `enclosingWindow` - the window that holds the page
      `ignoreSAXException` - Whether to ignore `SAXException` or throw it as `IOException`
      `handleXHTMLAsHTML` - if true elements from the XHTML namespace are handled as HTML elements instead of DOM elements
    Throws:
      `IOException` - if the page could not be created

- ## Method Details

  - ### initialize

    public void initialize() throws IOException
    Initialize this page. This method gets called when a new page is loaded and you should probably never need to call it directly.
    Throws:
      `IOException` - if an IO problem occurs

  - ### hasCaseSensitiveTagNames

    public boolean hasCaseSensitiveTagNames()
    Returns `true` if this page has case-sensitive tag names, `false` otherwise. In general, XML has case-sensitive tag names, and HTML doesn't. This is especially important during XPath matching.
    Specified by:
      `hasCaseSensitiveTagNames` in class `SgmlPage`
    Returns:
      `true` if this page has case-sensitive tag names, `false` otherwise

  - ### getXmlDocument

    public Document getXmlDocument()
    Returns the DOM representation of the XML content.
    Returns:
      `null` if the content couldn't be parsed

  - ### adoptNode

    public Node adoptNode(Node source)
    Not yet implemented.

  - ### createAttributeNS

    public Attr createAttributeNS(String namespaceURI, String qualifiedName)
    Not yet implemented.

  - ### createElement

    public DomElement createElement(String tagName)

  - ### createElementNS

    public DomElement createElementNS(String namespaceURI, String qualifiedName)

  - ### createEntityReference

    public EntityReference createEntityReference(String name)
    Not yet implemented.

  - ### createProcessingInstruction

    public DomProcessingInstruction createProcessingInstruction(String target, String data)

  - ### getDocumentURI

    public String getDocumentURI()
    Not yet implemented.

  - ### getDomConfig

    public DOMConfiguration getDomConfig()
    Not yet implemented.

  - ### getElementById

    public Element getElementById(String elementId)
    Not yet implemented.

  - ### getImplementation

    public DOMImplementation getImplementation()
    Not yet implemented.

  - ### getInputEncoding

    public String getInputEncoding()
    Not yet implemented.

  - ### getStrictErrorChecking

    public boolean getStrictErrorChecking()
    Not yet implemented.

  - ### getXmlEncoding

    public String getXmlEncoding()

  - ### getXmlStandalone

    public boolean getXmlStandalone()

  - ### getXmlVersion

    public String getXmlVersion()

  - ### importNode

    public Node importNode(Node importedNode, boolean deep)
    Not yet implemented.

  - ### renameNode

    public Node renameNode(Node n, String namespaceURI, String qualifiedName)
    Not yet implemented.

  - ### setDocumentURI

    public void setDocumentURI(String documentURI)
    Not yet implemented.

  - ### setStrictErrorChecking

    public void setStrictErrorChecking(boolean strictErrorChecking)
    Not yet implemented.

  - ### setXmlStandalone

    public void setXmlStandalone(boolean xmlStandalone)
    Not yet implemented.

  - ### setXmlVersion

    public void setXmlVersion(String xmlVersion)
    Not yet implemented.

  - ### getCharset

    public Charset getCharset()
    Returns the encoding.
    Specified by:
      `getCharset` in class `SgmlPage`
    Returns:
      the encoding

  - ### getContentType

    public String getContentType()
    Returns the content type of this page.
    Specified by:
      `getContentType` in class `SgmlPage`
    Returns:
      the content type of this page

  - ### setDocumentType

    public void setDocumentType(DocumentType type)
    Sets the document type.
    Overrides:
      `setDocumentType` in class `SgmlPage`
    Parameters:
      `type` - the document type

  - ### setNodeValue

    public void setNodeValue(String value)

  - ### setPrefix

    public void setPrefix(String prefix)