public abstract class SgmlPage extends DomNode implements Page, Document
DomNode.ChildIterator, DomNode.DescendantDomElementsIterator, DomNode.DescendantDomNodesIterator, DomNode.DescendantHtmlElementsIteratorPROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZEDATTRIBUTE_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 and Description |
|---|
SgmlPage(WebResponse webResponse,
WebWindow webWindow)
Creates an instance of SgmlPage.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asXml()
Returns a string representation as XML document from this element and all it's children (recursively).
|
void |
characterDataChangeListenerAdded()
Informs about the use of a characterDataChangeListener.
|
void |
cleanUp()
Clean up this page.
|
void |
clearComputedStyles()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
clearComputedStyles(DomElement element)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
clearComputedStylesUpToRoot(DomElement element)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
protected SgmlPage |
clone()
Creates a clone of this instance.
|
DomAttr |
createAttribute(String name) |
CDATASection |
createCDATASection(String data) |
Comment |
createComment(String data) |
DomDocumentFragment |
createDocumentFragment()
Creates an empty
DomDocumentFragment object. |
DomNodeIterator |
createNodeIterator(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
Create a new
NodeIterator over the subtree rooted at the
specified node. |
Text |
createTextNode(String data) |
void |
domChangeListenerAdded()
Informs about the use of a domChangeListener.
|
String |
getCanonicalXPath()
Returns the canonical XPath expression which identifies this node, for instance
"/html/body/table[3]/tbody/tr[5]/td[2]/span/a[3]". |
abstract Charset |
getCharset()
Returns the encoding.
|
abstract String |
getContentType()
Returns the content type of this page.
|
DocumentType |
getDoctype()
Returns the document type.
|
DomElement |
getDocumentElement()
Returns the document element.
|
DomNodeList<DomElement> |
getElementsByTagName(String tagName) |
DomNodeList<DomElement> |
getElementsByTagNameNS(String namespaceURI,
String localName) |
WebWindow |
getEnclosingWindow()
Returns the window that this page is sitting inside.
|
String |
getNodeName()
Gets the name for the current node.
|
short |
getNodeType()
Gets the type of the current node.
|
SgmlPage |
getPage()
Returns the page that contains this node.
|
URL |
getUrl()
Returns the URL of this page.
|
WebClient |
getWebClient()
Returns the WebClient that originally loaded this page.
|
WebResponse |
getWebResponse()
Returns the web response that was originally used to create this page.
|
abstract boolean |
hasCaseSensitiveTagNames()
Returns
true if this page has case-sensitive tag names, false otherwise. |
boolean |
isCharacterDataChangeListenerInUse() |
boolean |
isDomChangeListenerInUse() |
boolean |
isHtmlPage()
Returns true if this page is an HtmlPage.
|
boolean |
isPrinting() |
void |
normalizeDocument()
The current implementation just
DomNode.normalize()s the document element. |
protected void |
setDocumentType(DocumentType type)
Sets the document type.
|
void |
setEnclosingWindow(WebWindow window)
Sets the window that contains this page.
|
void |
setPrinting(boolean printing) |
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, setUserDataequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeadoptNode, createAttributeNS, createElement, createElementNS, createEntityReference, createProcessingInstruction, getDocumentURI, getDomConfig, getElementById, getImplementation, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersionappendChild, 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, setNodeValue, setPrefix, setTextContent, setUserDatapublic SgmlPage(WebResponse webResponse, WebWindow webWindow)
webResponse - the web response that was used to create this pagewebWindow - the window that this page is being loaded intopublic void cleanUp()
public WebResponse getWebResponse()
getWebResponse in interface Pagepublic String getNodeName()
getNodeName in interface Nodepublic short getNodeType()
getNodeType in interface Nodepublic WebWindow getEnclosingWindow()
getEnclosingWindow in interface Pagepublic void setEnclosingWindow(WebWindow window)
window - the new frame or null if this page is being removed from a framepublic WebClient getWebClient()
public DomDocumentFragment createDocumentFragment()
DomDocumentFragment object.createDocumentFragment in interface DocumentDomDocumentFragmentpublic final DocumentType getDoctype()
getDoctype in interface Documentprotected void setDocumentType(DocumentType type)
type - the document typepublic SgmlPage getPage()
public abstract Charset getCharset()
public DomElement getDocumentElement()
getDocumentElement in interface Documentprotected SgmlPage clone()
public String asXml()
public abstract boolean hasCaseSensitiveTagNames()
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.true if this page has case-sensitive tag names, false otherwisepublic void normalizeDocument()
DomNode.normalize()s the document element.normalizeDocument in interface Documentpublic String getCanonicalXPath()
Returns the canonical XPath expression which identifies this node, for instance
"/html/body/table[3]/tbody/tr[5]/td[2]/span/a[3]".
WARNING: This sort of automated XPath expression is often quite bad at identifying a node, as it is highly sensitive to changes in the DOM tree.
getCanonicalXPath in class DomNodeDomNode.getByXPath(String)public DomAttr createAttribute(String name)
createAttribute in interface Documentpublic URL getUrl()
public boolean isHtmlPage()
PageisHtmlPage in interface Pagepublic DomNodeList<DomElement> getElementsByTagName(String tagName)
getElementsByTagName in interface Documentpublic DomNodeList<DomElement> getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagNameNS in interface Documentpublic CDATASection createCDATASection(String data)
createCDATASection in interface Documentpublic Text createTextNode(String data)
createTextNode in interface Documentpublic Comment createComment(String data)
createComment in interface Documentpublic DomNodeIterator createNodeIterator(Node root, int whatToShow, org.w3c.dom.traversal.NodeFilter filter, boolean entityReferenceExpansion) throws DOMException
NodeIterator over the subtree rooted at the
specified node.root - The node which will be iterated together with its
children. The NodeIterator is initially positioned
just before this node. The whatToShow flags and the
filter, if any, are not considered when setting this position. The
root must not be null.whatToShow - This flag specifies which node types may appear in
the logical view of the tree presented by the
NodeIterator. See the description of
NodeFilter for the set of possible SHOW_
values.These flags can be combined using OR.filter - The NodeFilter to be used with this
NodeIterator, or null to indicate no
filter.entityReferenceExpansion - The value of this flag determines
whether entity reference nodes are expanded.NodeIterator.DOMException - NOT_SUPPORTED_ERR: Raised if the specified root is null.public abstract String getContentType()
public void clearComputedStyles()
public void clearComputedStyles(DomElement element)
Element.element - the element to clear its cachepublic void clearComputedStylesUpToRoot(DomElement element)
Element
and all parent elements.element - the element to clear its cachepublic boolean isPrinting()
public void setPrinting(boolean printing)
printing - the printing state to setpublic void domChangeListenerAdded()
public boolean isDomChangeListenerInUse()
public void characterDataChangeListenerAdded()
public boolean isCharacterDataChangeListenerInUse()
Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.