Package org.htmlunit.xml
Class XmlPage
- java.lang.Object
-
- org.htmlunit.html.DomNode
-
- org.htmlunit.SgmlPage
-
- org.htmlunit.xml.XmlPage
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Page,org.w3c.dom.Document,org.w3c.dom.Node,org.w3c.dom.traversal.DocumentTraversal
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.DescendantElementsIterator<T extends DomNode>
-
-
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(org.w3c.dom.Node node, WebWindow enclosingWindow)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.NodeadoptNode(org.w3c.dom.Node source)Not yet implemented.org.w3c.dom.AttrcreateAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)Not yet implemented.DomElementcreateElement(java.lang.String tagName)DomElementcreateElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)org.w3c.dom.EntityReferencecreateEntityReference(java.lang.String name)Not yet implemented.DomProcessingInstructioncreateProcessingInstruction(java.lang.String target, java.lang.String data)java.nio.charset.CharsetgetCharset()Returns the encoding.java.lang.StringgetContentType()Returns the content type of this page.java.lang.StringgetDocumentURI()Not yet implemented.org.w3c.dom.DOMConfigurationgetDomConfig()Not yet implemented.org.w3c.dom.ElementgetElementById(java.lang.String elementId)Not yet implemented.org.w3c.dom.DOMImplementationgetImplementation()Not yet implemented.java.lang.StringgetInputEncoding()Not yet implemented.booleangetStrictErrorChecking()Not yet implemented.org.w3c.dom.DocumentgetXmlDocument()Returns the DOM representation of the XML content.java.lang.StringgetXmlEncoding()booleangetXmlStandalone()java.lang.StringgetXmlVersion()booleanhasCaseSensitiveTagNames()Returnstrueif this page has case-sensitive tag names,falseotherwise.org.w3c.dom.NodeimportNode(org.w3c.dom.Node importedNode, boolean deep)Not yet implemented.voidinitialize()Initialize this page.org.w3c.dom.NoderenameNode(org.w3c.dom.Node n, java.lang.String namespaceURI, java.lang.String qualifiedName)Not yet implemented.voidsetDocumentType(org.w3c.dom.DocumentType type)Sets the document type.voidsetDocumentURI(java.lang.String documentURI)Not yet implemented.voidsetNodeValue(java.lang.String value)voidsetPrefix(java.lang.String prefix)voidsetStrictErrorChecking(boolean strictErrorChecking)Not yet implemented.voidsetXmlStandalone(boolean xmlStandalone)Not yet implemented.voidsetXmlVersion(java.lang.String xmlVersion)Not yet implemented.-
Methods inherited from class org.htmlunit.SgmlPage
asXml, cleanUp, clearComputedStyles, clearComputedStyles, clearComputedStylesUpToRoot, clone, createAttribute, createCDATASection, createComment, createDocumentFragment, createNodeIterator, createTextNode, createTreeWalker, getCanonicalXPath, getDoctype, getDocumentElement, getElementsByTagName, getElementsByTagNameNS, getEnclosingWindow, getNodeName, getNodeType, getPage, getUrl, getWebClient, getWebResponse, 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 Detail
-
XmlPage
public XmlPage(WebResponse webResponse, WebWindow enclosingWindow) throws java.io.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 serverenclosingWindow- the window that holds the page- Throws:
java.io.IOException- if the page could not be created
-
XmlPage
public XmlPage(org.w3c.dom.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 withenclosingWindow- the window that holds the page
-
XmlPage
public XmlPage(WebResponse webResponse, WebWindow enclosingWindow, boolean ignoreSAXException) throws java.io.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 serverenclosingWindow- the window that holds the pageignoreSAXException- Whether to ignoreSAXExceptionor throw it asIOException- Throws:
java.io.IOException- if the page could not be created
-
XmlPage
public XmlPage(WebResponse webResponse, WebWindow enclosingWindow, boolean ignoreSAXException, boolean handleXHTMLAsHTML) throws java.io.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 serverenclosingWindow- the window that holds the pageignoreSAXException- Whether to ignoreSAXExceptionor throw it asIOExceptionhandleXHTMLAsHTML- if true elements from the XHTML namespace are handled as HTML elements instead of DOM elements- Throws:
java.io.IOException- if the page could not be created
-
-
Method Detail
-
initialize
public void initialize() throws java.io.IOExceptionInitialize this page. This method gets called when a new page is loaded and you should probably never need to call it directly.- Throws:
java.io.IOException- if an IO problem occurs
-
hasCaseSensitiveTagNames
public boolean hasCaseSensitiveTagNames()
Returnstrueif this page has case-sensitive tag names,falseotherwise. In general, XML has case-sensitive tag names, and HTML doesn't. This is especially important during XPath matching.- Specified by:
hasCaseSensitiveTagNamesin classSgmlPage- Returns:
trueif this page has case-sensitive tag names,falseotherwise
-
getXmlDocument
public org.w3c.dom.Document getXmlDocument()
Returns the DOM representation of the XML content.- Returns:
nullif the content couldn't be parsed
-
adoptNode
public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source)
Not yet implemented.
-
createAttributeNS
public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)Not yet implemented.
-
createElement
public DomElement createElement(java.lang.String tagName)
-
createElementNS
public DomElement createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
-
createEntityReference
public org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
Not yet implemented.
-
createProcessingInstruction
public DomProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
-
getDocumentURI
public java.lang.String getDocumentURI()
Not yet implemented.
-
getDomConfig
public org.w3c.dom.DOMConfiguration getDomConfig()
Not yet implemented.
-
getElementById
public org.w3c.dom.Element getElementById(java.lang.String elementId)
Not yet implemented.
-
getImplementation
public org.w3c.dom.DOMImplementation getImplementation()
Not yet implemented.
-
getInputEncoding
public java.lang.String getInputEncoding()
Not yet implemented.
-
getStrictErrorChecking
public boolean getStrictErrorChecking()
Not yet implemented.
-
getXmlEncoding
public java.lang.String getXmlEncoding()
-
getXmlStandalone
public boolean getXmlStandalone()
-
getXmlVersion
public java.lang.String getXmlVersion()
-
importNode
public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep)Not yet implemented.
-
renameNode
public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, java.lang.String namespaceURI, java.lang.String qualifiedName)Not yet implemented.
-
setDocumentURI
public void setDocumentURI(java.lang.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(java.lang.String xmlVersion)
Not yet implemented.
-
getCharset
public java.nio.charset.Charset getCharset()
Returns the encoding.- Specified by:
getCharsetin classSgmlPage- Returns:
- the encoding
-
getContentType
public java.lang.String getContentType()
Returns the content type of this page.- Specified by:
getContentTypein classSgmlPage- Returns:
- the content type of this page
-
setDocumentType
public void setDocumentType(org.w3c.dom.DocumentType type)
Sets the document type.- Overrides:
setDocumentTypein classSgmlPage- Parameters:
type- the document type
-
setNodeValue
public void setNodeValue(java.lang.String value)
-
setPrefix
public void setPrefix(java.lang.String prefix)
-
-