@DOMObjectAttribute @DOMNameAttribute(name="Document") public class Document extends Node implements IDocumentTraversal, IXPathEvaluator, IDocumentEvent, IParentNode, INonElementParentNode, IDocumentStyle
The Document represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.
Modifier and Type | Class and Description |
---|---|
static class |
Document.DocumentInit |
static class |
Document.NavigationInit |
static class |
Document.NavigationWorkItem |
Node.Flags
Modifier and Type | Field and Description |
---|---|
com.aspose.html.dom.runtime.modules.ILinkScript |
CurrentScript |
int |
IgnoreDestructiveWritesCounter |
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnAbort |
DOMEventHandler |
OnAbortDelegate
Gets or sets event handler for OnAbort event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnBlur |
DOMEventHandler |
OnBlurDelegate
Gets or sets event handler for OnBlur event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnCancel |
DOMEventHandler |
OnCancelDelegate
Gets or sets event handler for OnCancel event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnCanplay |
DOMEventHandler |
OnCanplayDelegate
Gets or sets event handler for OnCanplay event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnCanPlayThrough |
DOMEventHandler |
OnCanPlayThroughDelegate
Gets or sets event handler for OnCanPlayThrough event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnChange |
DOMEventHandler |
OnChangeDelegate
Gets or sets event handler for OnChange event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnClick |
DOMEventHandler |
OnClickDelegate
Gets or sets event handler for OnClick event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnCueChange |
DOMEventHandler |
OnCueChangeDelegate
Gets or sets event handler for OnCueChange event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnDblClick |
DOMEventHandler |
OnDblClickDelegate
Gets or sets event handler for OnDblClick event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnDurationChange |
DOMEventHandler |
OnDurationChangeDelegate
Gets or sets event handler for OnDurationChange event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnEmptied |
DOMEventHandler |
OnEmptiedDelegate
Gets or sets event handler for OnEmptied event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnEnded |
DOMEventHandler |
OnEndedDelegate
Gets or sets event handler for OnEnded event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnError |
DOMEventHandler |
OnErrorDelegate
Gets or sets event handler for OnError event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnFocus |
DOMEventHandler |
OnFocusDelegate
Gets or sets event handler for OnFocus event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnInput |
DOMEventHandler |
OnInputDelegate
Gets or sets event handler for OnInput event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnInvalid |
DOMEventHandler |
OnInvalidDelegate
Gets or sets event handler for OnInvalid event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnKeyDown |
DOMEventHandler |
OnKeyDownDelegate
Gets or sets event handler for OnKeyDown event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnKeyPress |
DOMEventHandler |
OnKeyPressDelegate
Gets or sets event handler for OnKeyPress event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnKeyUp |
DOMEventHandler |
OnKeyUpDelegate
Gets or sets event handler for OnKeyUp event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnLoad |
DOMEventHandler |
OnLoadDelegate
Gets or sets event handler for OnLoad event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnLoadedData |
DOMEventHandler |
OnLoadedDataDelegate
Gets or sets event handler for OnLoadedData event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnLoadedMetadata |
DOMEventHandler |
OnLoadedMetadataDelegate
Gets or sets event handler for OnLoadedMetadata event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnLoadStart |
DOMEventHandler |
OnLoadStartDelegate
Gets or sets event handler for OnLoadStart event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseDown |
DOMEventHandler |
OnMouseDownDelegate
Gets or sets event handler for OnMouseDown event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseEnter |
DOMEventHandler |
OnMouseEnterDelegate
Gets or sets event handler for OnMouseEnter event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseLeave |
DOMEventHandler |
OnMouseLeaveDelegate
Gets or sets event handler for OnMouseLeave event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseMove |
DOMEventHandler |
OnMouseMoveDelegate
Gets or sets event handler for OnMouseMove event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseOut |
DOMEventHandler |
OnMouseOutDelegate
Gets or sets event handler for OnMouseOut event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseOver |
DOMEventHandler |
OnMouseOverDelegate
Gets or sets event handler for OnMouseOver event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseUp |
DOMEventHandler |
OnMouseUpDelegate
Gets or sets event handler for OnMouseUp event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnMouseWheel |
DOMEventHandler |
OnMouseWheelDelegate
Gets or sets event handler for OnMouseWheel event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnPause |
DOMEventHandler |
OnPauseDelegate
Gets or sets event handler for OnPause event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnPlay |
DOMEventHandler |
OnPlayDelegate
Gets or sets event handler for OnPlay event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnPlaying |
DOMEventHandler |
OnPlayingDelegate
Gets or sets event handler for OnPlaying event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnProgress |
DOMEventHandler |
OnProgressDelegate
Gets or sets event handler for OnProgress event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnRateChange |
DOMEventHandler |
OnRateChangeDelegate
Gets or sets event handler for OnRateChange event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnReadyStateChange |
DOMEventHandler |
OnReadyStateChangeDelegate
Gets or sets event handler for OnReadyStateChange event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnReset |
DOMEventHandler |
OnResetDelegate
Gets or sets event handler for OnReset event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnResize |
DOMEventHandler |
OnResizeDelegate
Gets or sets event handler for OnResize event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnScroll |
DOMEventHandler |
OnScrollDelegate
Gets or sets event handler for OnScroll event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnSeeked |
DOMEventHandler |
OnSeekedDelegate
Gets or sets event handler for OnSeeked event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnSeeking |
DOMEventHandler |
OnSeekingDelegate
Gets or sets event handler for OnSeeking event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnSelect |
DOMEventHandler |
OnSelectDelegate
Gets or sets event handler for OnSelect event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnShow |
DOMEventHandler |
OnShowDelegate
Gets or sets event handler for OnShow event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnStalled |
DOMEventHandler |
OnStalledDelegate
Gets or sets event handler for OnStalled event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnSubmit |
DOMEventHandler |
OnSubmitDelegate
Gets or sets event handler for OnSubmit event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnSuspend |
DOMEventHandler |
OnSuspendDelegate
Gets or sets event handler for OnSuspend event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnTimeUpdate |
DOMEventHandler |
OnTimeUpdateDelegate
Gets or sets event handler for OnTimeUpdate event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnToggle |
DOMEventHandler |
OnToggleDelegate
Gets or sets event handler for OnToggle event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnVolumeChange |
DOMEventHandler |
OnVolumeChangeDelegate
Gets or sets event handler for OnVolumeChange event.
|
com.aspose.html.internal.ms.lang.Event<DOMEventHandler> |
OnWaiting |
DOMEventHandler |
OnWaitingDelegate
Gets or sets event handler for OnWaiting event.
|
com.aspose.html.dom.runtime.modules.ILinkScript |
PendingRarsingBlockingScript |
static String |
READY_STATE_COMPLETE |
static String |
READY_STATE_INTERACTIVE |
static String |
READY_STATE_LOADING |
long |
revision |
String |
strCDataSectionName |
String |
strCommentName |
String |
strDocumentFragmentName |
String |
strDocumentName |
String |
strEntityName |
String |
strReservedXhtmlns |
String |
strReservedXml |
String |
strReservedXmlns |
String |
strSignificantWhitespaceName |
String |
strSpace |
String |
strTextName |
String |
strXml |
String |
strXmlns |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, flags, nodeDocument, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
EventMap
PropertyChanged
Constructor and Description |
---|
Document(com.aspose.html.BrowsingContext context)
Initializes a new instance of the
Document class. |
Document(com.aspose.html.BrowsingContext context,
Document.DocumentInit init) |
Modifier and Type | Method and Description |
---|---|
Node |
adoptNode(Node source)
Attempts to adopt a node from another document to this document.
|
Attr |
createAttribute(String localName)
Creates an Attr of the given name.
|
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName)
Creates an attribute of the given qualified name and namespace URI.
|
CDATASection |
createCDATASection(String data)
Creates a CDATASection node whose value is the specified string.
|
Comment |
createComment(String data)
Creates a Comment node given the specified string.
|
DocumentFragment |
createDocumentFragment()
Creates an empty DocumentFragment object.
|
DocumentType |
createDocumentType(String name,
String publicId,
String systemId,
String internalSubset)
Creates a DocumentType node.
|
Element |
createElement(String localName)
Creates an element of the type specified.
|
Element |
createElementNS(String namespaceURI,
String qualifiedName)
Creates an element of the given qualified name and namespace URI.
|
EntityReference |
createEntityReference(String name)
Creates an EntityReference object.
|
Event |
createEvent(String eventType)
Creates an
Event of a type supported by the implementation. |
IXPathExpression |
createExpression(String expression,
IXPathNSResolver resolver)
Creates a parsed XPath expression with resolved namespaces.
|
INodeIterator |
createNodeIterator(Node root,
long whatToShow,
INodeFilter filter)
Create a new NodeIterator over the subtree rooted at the
specified node.
|
IXPathNSResolver |
createNSResolver(Node nodeResolver)
Adapts any DOM node to resolve namespaces so that an XPath expression can be easily evaluated
relative to the context of the node where it appeared within the document.
|
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
Creates a ProcessingInstruction node given the specified name and data strings.
|
Text |
createTextNode(String data)
Creates a Text node given the specified string.
|
ITreeWalker |
createTreeWalker(Node root,
long whatToShow,
INodeFilter filter)
Create a new TreeWalker over the subtree rooted at the
specified node.
|
IXPathResult |
evaluate(String expression,
Node contextNode,
IXPathNSResolver resolver,
int type,
Object result)
Evaluates an XPath expression string and returns a result of the specified type if possible.
|
String |
getBaseURI()
The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI.
|
com.aspose.html.BrowsingContext |
getBrowsingContext()
Gets the current browsing context as a internal object.
|
String |
getCharacterSet()
Gets the document's encoding.
|
String |
getCharset()
Gets the document's encoding.
|
int |
getChildElementCount()
Returns the current number of element nodes that are children of this element. 0 if this element has no child nodes that are of nodeType 1.
|
HTMLCollection |
getChildren()
Returns the child elements.
|
com.aspose.html.dom.css.engine.CSSStyleDeclaration |
getComputedStyle(String pseudoElement)
This method is used to get the computed style as it is defined in CSS2.
|
String |
getContentType()
Gets the document content type.
|
IBrowsingContext |
getContext()
Gets the current browsing context.
|
com.aspose.html.internal.ms.System.Net.CookieContainer |
getCookies() |
IWindow |
getDefaultView()
The defaultView IDL attribute of the Document interface, on getting,
must return this Document's browsing context's WindowProxy object,
if this Document has an associated browsing context, or null otherwise.
|
DocumentType |
getDoctype()
The Document Type Declaration associated with this document.
|
Element |
getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the document element of the document.
|
String |
getDocumentURI()
The location of the document or null if undefined or if the Document was created using DOMImplementation.createDocument.
|
Element |
getElementById(String elementId)
Returns the Element that has an ID attribute with the given value.
|
HTMLCollection |
getElementsByClassName(String classNames)
Returns a live NodeList object containing all the elements in the document that have all the classes specified in argument.
|
HTMLCollection |
getElementsByTagName(String tagname)
Returns a NodeList of all the Elements in document order with a given tag name and are contained in the document.
|
HTMLCollection |
getElementsByTagNameNS(String namespaceURI,
String localName)
Returns a NodeList of all the Elements with a given local name and namespace URI in document order.
|
Element |
getFirstElementChild()
Returns the first child element node of this element. null if this element has no child elements.
|
IDOMImplementation |
getImplementation()
The DOMImplementation object that handles this document.
|
String |
getInputEncoding()
Gets the document's encoding.
|
com.aspose.html.dom.traversal.NodeIterator.NodeIteratorCollection |
getIterators() |
Element |
getLastElementChild()
Returns the last child element node of this element. null if this element has no child elements.
|
Location |
getLocation()
The location of the document.
|
MimeType |
getMimeType() |
com.aspose.html.internal.ms.System.Xml.XmlNameTable |
getNameTable()
Gets the
XmlNameTable associated with this implementation. |
Element |
getNextElementSibling()
Returns the next sibling element node of this element. null if this element has no element sibling nodes that come after this one in the document tree.
|
String |
getNodeName()
The name of this node, depending on its type.
|
int |
getNodeType()
A code representing the type of the underlying object.
|
String |
getOrigin()
Gets the document origin.
|
Document |
getOwnerDocument()
Gets the owner document.
|
com.aspose.html.ls.parser.DOMBuilderBase |
getParser() |
Element |
getPreviousElementSibling()
Returns the previous sibling element node of this element. null if this element has no element sibling nodes that come before this one in the document tree.
|
byte |
getQuirksMode() |
String |
getReadyState()
Returns the document readiness.
|
boolean |
getStrictErrorChecking()
An attribute specifying whether error checking is enforced or not.
|
com.aspose.html.dom.css.engine.CSSStyleContainer |
getStyleContainer()
Gets the style container.
|
IStyleSheetList |
getStyleSheets()
A list containing all the style sheets explicitly linked into or embedded in a document.
|
boolean |
getXmlStandalone()
An attribute specifying, as part of the XML declaration, whether this document is standalone.
|
String |
getXmlVersion()
An attribute specifying, as part of the XML declaration, the version number of this document.
|
Node |
importNode(Node importedNode,
boolean deep)
Imports a node from another document to this document, without altering or removing the source node from the original document; this method creates a new copy of the source node.
|
void |
navigate(RequestMessage request)
Loads the document based on specified request object, replacing the previous content.
|
void |
navigate(ResponseMessage response,
byte flags)
Loads the document based on specified response object, replacing the previous content.
|
void |
navigate(com.aspose.html.internal.ms.System.IO.Stream content,
String baseUri)
Loads the document from specified content and using baseUri to resolve relative resources, replacing the previous content.
|
void |
navigate(String address)
Loads the document at the specified Uniform Resource Locator (URL) into the current instance, replacing the previous content.
|
void |
navigate(String content,
String baseUri)
Loads the document from specified content and using baseUri to resolve relative resources, replacing the previous content.
|
void |
navigate(Url url)
Loads the document at the specified Uniform Resource Locator (URL) into the current instance, replacing the previous content.
|
Element |
querySelector(String selector)
Returns the first Element in document, which match selector
|
NodeList |
querySelectorAll(String selector)
Returns a NodeList of all the Elements in document, which match selector
|
void |
renderTo(IDevice device)
This method is used to render the contents of the current document to a specified graphical device.
|
void |
setContentType(String value)
Gets the document content type.
|
void |
setLocation(Location value)
The location of the document.
|
void |
setQuirksMode(byte value) |
void |
setReadyState(String value)
Returns the document readiness.
|
void |
setStrictErrorChecking(boolean value)
An attribute specifying whether error checking is enforced or not.
|
void |
setXmlStandalone(boolean value)
An attribute specifying, as part of the XML declaration, whether this document is standalone.
|
void |
setXmlVersion(String value)
An attribute specifying, as part of the XML declaration, the version number of this document.
|
void |
write(String... texts)
Write a string of text to a document stream opened by
open().
|
void |
writeLn(String... texts)
Write a string of text followed by a newline character to a document
stream opened by open().
|
adoptNode, appendChild, cloneNode, deepClone, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getParentElement, getParentNode, getPrefix, getPreviousSibling, getRegisteredObservers, getTextContent, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceAll, replaceChild, setNodeValue, setParentNode, setPrefix, setTextContent, toString
addEventListener, addEventListener, addEventListener, addEventListener, dispatchEvent, dispose, removeEventListener, removeEventListener, removeEventListener
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
public static final String READY_STATE_LOADING
public static final String READY_STATE_INTERACTIVE
public static final String READY_STATE_COMPLETE
public long revision
public String strCDataSectionName
public String strCommentName
public String strDocumentFragmentName
public String strDocumentName
public String strEntityName
public String strTextName
public String strReservedXml
public String strReservedXmlns
public String strReservedXhtmlns
public String strSignificantWhitespaceName
public String strSpace
public String strXml
public String strXmlns
public com.aspose.html.dom.runtime.modules.ILinkScript PendingRarsingBlockingScript
public com.aspose.html.dom.runtime.modules.ILinkScript CurrentScript
public int IgnoreDestructiveWritesCounter
public DOMEventHandler OnReadyStateChangeDelegate
Gets or sets event handler for OnReadyStateChange event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnReadyStateChange
public DOMEventHandler OnAbortDelegate
Gets or sets event handler for OnAbort event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnAbort
public DOMEventHandler OnBlurDelegate
Gets or sets event handler for OnBlur event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnBlur
public DOMEventHandler OnCancelDelegate
Gets or sets event handler for OnCancel event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnCancel
public DOMEventHandler OnCanplayDelegate
Gets or sets event handler for OnCanplay event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnCanplay
public DOMEventHandler OnCanPlayThroughDelegate
Gets or sets event handler for OnCanPlayThrough event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnCanPlayThrough
public DOMEventHandler OnChangeDelegate
Gets or sets event handler for OnChange event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnChange
public DOMEventHandler OnClickDelegate
Gets or sets event handler for OnClick event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnClick
public DOMEventHandler OnCueChangeDelegate
Gets or sets event handler for OnCueChange event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnCueChange
public DOMEventHandler OnDblClickDelegate
Gets or sets event handler for OnDblClick event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnDblClick
public DOMEventHandler OnDurationChangeDelegate
Gets or sets event handler for OnDurationChange event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnDurationChange
public DOMEventHandler OnEmptiedDelegate
Gets or sets event handler for OnEmptied event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnEmptied
public DOMEventHandler OnEndedDelegate
Gets or sets event handler for OnEnded event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnEnded
public DOMEventHandler OnErrorDelegate
Gets or sets event handler for OnError event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnError
public DOMEventHandler OnFocusDelegate
Gets or sets event handler for OnFocus event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnFocus
public DOMEventHandler OnInputDelegate
Gets or sets event handler for OnInput event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnInput
public DOMEventHandler OnInvalidDelegate
Gets or sets event handler for OnInvalid event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnInvalid
public DOMEventHandler OnKeyDownDelegate
Gets or sets event handler for OnKeyDown event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnKeyDown
public DOMEventHandler OnKeyPressDelegate
Gets or sets event handler for OnKeyPress event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnKeyPress
public DOMEventHandler OnKeyUpDelegate
Gets or sets event handler for OnKeyUp event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnKeyUp
public DOMEventHandler OnLoadDelegate
Gets or sets event handler for OnLoad event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnLoad
public DOMEventHandler OnLoadedDataDelegate
Gets or sets event handler for OnLoadedData event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnLoadedData
public DOMEventHandler OnLoadedMetadataDelegate
Gets or sets event handler for OnLoadedMetadata event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnLoadedMetadata
public DOMEventHandler OnLoadStartDelegate
Gets or sets event handler for OnLoadStart event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnLoadStart
public DOMEventHandler OnMouseDownDelegate
Gets or sets event handler for OnMouseDown event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseDown
public DOMEventHandler OnMouseEnterDelegate
Gets or sets event handler for OnMouseEnter event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseEnter
public DOMEventHandler OnMouseLeaveDelegate
Gets or sets event handler for OnMouseLeave event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseLeave
public DOMEventHandler OnMouseMoveDelegate
Gets or sets event handler for OnMouseMove event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseMove
public DOMEventHandler OnMouseOutDelegate
Gets or sets event handler for OnMouseOut event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseOut
public DOMEventHandler OnMouseOverDelegate
Gets or sets event handler for OnMouseOver event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseOver
public DOMEventHandler OnMouseUpDelegate
Gets or sets event handler for OnMouseUp event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseUp
public DOMEventHandler OnMouseWheelDelegate
Gets or sets event handler for OnMouseWheel event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnMouseWheel
public DOMEventHandler OnPauseDelegate
Gets or sets event handler for OnPause event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnPause
public DOMEventHandler OnPlayDelegate
Gets or sets event handler for OnPlay event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnPlay
public DOMEventHandler OnPlayingDelegate
Gets or sets event handler for OnPlaying event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnPlaying
public DOMEventHandler OnProgressDelegate
Gets or sets event handler for OnProgress event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnProgress
public DOMEventHandler OnRateChangeDelegate
Gets or sets event handler for OnRateChange event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnRateChange
public DOMEventHandler OnResetDelegate
Gets or sets event handler for OnReset event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnReset
public DOMEventHandler OnResizeDelegate
Gets or sets event handler for OnResize event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnResize
public DOMEventHandler OnScrollDelegate
Gets or sets event handler for OnScroll event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnScroll
public DOMEventHandler OnSeekedDelegate
Gets or sets event handler for OnSeeked event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnSeeked
public DOMEventHandler OnSeekingDelegate
Gets or sets event handler for OnSeeking event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnSeeking
public DOMEventHandler OnSelectDelegate
Gets or sets event handler for OnSelect event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnSelect
public DOMEventHandler OnShowDelegate
Gets or sets event handler for OnShow event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnShow
public DOMEventHandler OnStalledDelegate
Gets or sets event handler for OnStalled event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnStalled
public DOMEventHandler OnSubmitDelegate
Gets or sets event handler for OnSubmit event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnSubmit
public DOMEventHandler OnSuspendDelegate
Gets or sets event handler for OnSuspend event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnSuspend
public DOMEventHandler OnTimeUpdateDelegate
Gets or sets event handler for OnTimeUpdate event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnTimeUpdate
public DOMEventHandler OnToggleDelegate
Gets or sets event handler for OnToggle event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnToggle
public DOMEventHandler OnVolumeChangeDelegate
Gets or sets event handler for OnVolumeChange event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnVolumeChange
public DOMEventHandler OnWaitingDelegate
Gets or sets event handler for OnWaiting event.
public com.aspose.html.internal.ms.lang.Event<DOMEventHandler> OnWaiting
public Document(com.aspose.html.BrowsingContext context)
Initializes a new instance of the Document
class.
context
- The browsing context.public Document(com.aspose.html.BrowsingContext context, Document.DocumentInit init)
public void navigate(String address)
Loads the document at the specified Uniform Resource Locator (URL) into the current instance, replacing the previous content.
address
- The document address.public void navigate(Url url)
Loads the document at the specified Uniform Resource Locator (URL) into the current instance, replacing the previous content.
url
- The document URL.public void navigate(String content, String baseUri)
Loads the document from specified content and using baseUri to resolve relative resources, replacing the previous content.
content
- The document content.baseUri
- The base URI to resolve relative resources.com.aspose.html.internal.ms.System.ArgumentNullException
- baseUri
is null
.public void navigate(com.aspose.html.internal.ms.System.IO.Stream content, String baseUri)
Loads the document from specified content and using baseUri to resolve relative resources, replacing the previous content.
content
- The document content.baseUri
- The base URI to resolve relative resources.com.aspose.html.internal.ms.System.ArgumentNullException
- baseUri
is null
.public void navigate(RequestMessage request)
Loads the document based on specified request object, replacing the previous content.
request
- The request object that is used to load document content.public void navigate(ResponseMessage response, byte flags)
Loads the document based on specified response object, replacing the previous content.
response
- The request object that is used to load document content.public com.aspose.html.internal.ms.System.Net.CookieContainer getCookies()
public com.aspose.html.internal.ms.System.Xml.XmlNameTable getNameTable()
Gets the XmlNameTable
associated with this implementation.
public Document getOwnerDocument()
Gets the owner document.
Value: The owner document.getOwnerDocument
in class Node
public IBrowsingContext getContext()
Gets the current browsing context.
Value: The context.public com.aspose.html.BrowsingContext getBrowsingContext()
Gets the current browsing context as a internal object.
Value: The browsing context.@DOMNameAttribute(name="implementation") public IDOMImplementation getImplementation()
The DOMImplementation object that handles this document.
public Location getLocation()
The location of the document.
Value: The location.public void setLocation(Location value)
The location of the document.
Value: The location.@DOMNameAttribute(name="documentURI") public String getDocumentURI()
The location of the document or null if undefined or if the Document was created using DOMImplementation.createDocument.
Value: The document URI.@DOMNameAttribute(name="origin") public String getOrigin()
Gets the document origin.
Value: The origin.public String getBaseURI()
The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI.
getBaseURI
in class Node
public String getNodeName()
The name of this node, depending on its type.
Value: The name of the node.getNodeName
in class Node
public int getNodeType()
A code representing the type of the underlying object.
Value: The type of the node.getNodeType
in class Node
public byte getQuirksMode()
public void setQuirksMode(byte value)
@DOMNameAttribute(name="characterSet") public String getCharacterSet()
Gets the document's encoding.
Value: The document's encoding.@DOMNameAttribute(name="charset") public String getCharset()
Gets the document's encoding.
Value: The document's encoding.@DOMNameAttribute(name="inputEncoding") public String getInputEncoding()
Gets the document's encoding.
Value: The document's encoding.@DOMNameAttribute(name="contentType") public String getContentType()
Gets the document content type.
Value: The type of the content.@DOMNameAttribute(name="contentType") public void setContentType(String value)
Gets the document content type.
Value: The type of the content.@DOMNameAttribute(name="readyState") public String getReadyState()
Returns the document readiness. The "loading" while the Document is loading, "interactive" once it is finished parsing but still loading sub-resources, and "complete" once it has loaded.
@DOMNameAttribute(name="readyState") public void setReadyState(String value)
Returns the document readiness. The "loading" while the Document is loading, "interactive" once it is finished parsing but still loading sub-resources, and "complete" once it has loaded.
public MimeType getMimeType()
@DOMNameAttribute(name="doctype") @DOMNullableAttribute public DocumentType getDoctype()
The Document Type Declaration associated with this document.
Value: The Document Type.@DOMNameAttribute(name="documentElement") public Element getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the document element of the document.
Value: The document element.@DOMNameAttribute(name="createElement") public Element createElement(String localName)
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.
localName
- Name of the tag.Element
.@DOMNameAttribute(name="createElementNS") public Element createElementNS(String namespaceURI, String qualifiedName)
Creates an element of the given qualified name and namespace URI.
namespaceURI
- The namespace URI.qualifiedName
- Name of the qualified.Element
.@DOMNameAttribute(name="createDocumentFragment") public DocumentFragment createDocumentFragment()
Creates an empty DocumentFragment object.
DocumentFragment
.@DOMNameAttribute(name="createTextNode") public Text createTextNode(String data)
Creates a Text node given the specified string.
data
- The text data.Text
.@DOMNameAttribute(name="createComment") public Comment createComment(String data)
Creates a Comment node given the specified string.
data
- The comment data.Comment
.@DOMNameAttribute(name="createCDATASection") public CDATASection createCDATASection(String data)
Creates a CDATASection node whose value is the specified string.
data
- The CDATA data.CDATASection
.@DOMNameAttribute(name="createProcessingInstruction") public ProcessingInstruction createProcessingInstruction(String target, String data)
Creates a ProcessingInstruction node given the specified name and data strings.
target
- The target.data
- The instruction data.ProcessingInstruction
.@DOMNameAttribute(name="createAttribute") public Attr createAttribute(String localName)
Creates an Attr of the given name.
localName
- The attribute name.Attr
.@DOMNameAttribute(name="createAttributeNS") public Attr createAttributeNS(String namespaceURI, String qualifiedName)
Creates an attribute of the given qualified name and namespace URI.
namespaceURI
- The namespace URI.qualifiedName
- Name of the qualified.Attr
.@DOMNameAttribute(name="createEntityReference") public EntityReference createEntityReference(String name)
Creates an EntityReference object. In addition, if the referenced entity is known, the child list of the EntityReference node is made the same as that of the corresponding Entity node.
name
- The entity name.EntityReference
.@DOMNameAttribute(name="createDocumentType") public DocumentType createDocumentType(String name, String publicId, String systemId, String internalSubset)
Creates a DocumentType node.
name
- The document type name.publicId
- The public id.systemId
- The system id.internalSubset
- The internal subset.DocumentType
.@DOMNameAttribute(name="getElementsByTagName") public HTMLCollection getElementsByTagName(String tagname)
Returns a NodeList of all the Elements in document order with a given tag name and are contained in the document.
tagname
- The tagname.@DOMNameAttribute(name="getElementsByTagNameNS") public HTMLCollection getElementsByTagNameNS(String namespaceURI, String localName)
Returns a NodeList of all the Elements with a given local name and namespace URI in document order.
namespaceURI
- The namespace URI.localName
- Name of the local.public Element getElementById(String elementId)
Returns the Element that has an ID attribute with the given value. If no such element exists, this returns null. If more than one element has an ID attribute with that value, what is returned is undefined.
getElementById
in interface INonElementParentNode
elementId
- The element id.Element
.@DOMNameAttribute(name="getElementsByClassName") public HTMLCollection getElementsByClassName(String classNames)
Returns a live NodeList object containing all the elements in the document that have all the classes specified in argument. http://www.w3.org/TR/dom/
classNames
- The string string that contains an unordered set of unique space-separated tokens representing classes (class names)Element
.public INodeIterator createNodeIterator(Node root, long whatToShow, INodeFilter filter)
Create a new NodeIterator over the subtree rooted at the specified node.
createNodeIterator
in interface IDocumentTraversal
root
- node which will be iterated together with its children.
The iterator 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
- flag specifies which node types may appear in
the logical view of the tree presented by the iterator. See the
description of NodeFilter for the set of possible
SHOW_ values.These flags can be combined using
OR.filter
- NodeFilter to be used with this
TreeWalker, or null to indicate no filter.DOMException
- NOT_SUPPORTED_ERR: Raised if the specified root is
null.public ITreeWalker createTreeWalker(Node root, long whatToShow, INodeFilter filter)
Create a new TreeWalker over the subtree rooted at the specified node.
createTreeWalker
in interface IDocumentTraversal
root
- node which will serve as the root for the
TreeWalker. The whatToShow flags and the
NodeFilter are not considered when setting this value;
any node type will be accepted as the root. The
currentNode of the TreeWalker is
initialized to this node, whether or not it is visible. The
root functions as a stopping point for traversal
methods that look upward in the document structure, such as
parentNode and nextNode. The root must
not be null.whatToShow
- flag specifies which node types may appear in
the logical view of the tree presented by the tree-walker. See the
description of NodeFilter for the set of possible
SHOW_ values.These flags can be combined using OR.filter
- NodeFilter to be used with this
TreeWalker, or null to indicate no filter.DOMException
- NOT_SUPPORTED_ERR: Raised if the specified root is
null.public Element getFirstElementChild()
Returns the first child element node of this element. null if this element has no child elements.
getFirstElementChild
in interface IParentNode
getFirstElementChild
in interface IElementTraversal
public Element getLastElementChild()
Returns the last child element node of this element. null if this element has no child elements.
getLastElementChild
in interface IParentNode
getLastElementChild
in interface IElementTraversal
public Element getPreviousElementSibling()
Returns the previous sibling element node of this element. null if this element has no element sibling nodes that come before this one in the document tree.
getPreviousElementSibling
in interface IElementTraversal
public Element getNextElementSibling()
Returns the next sibling element node of this element. null if this element has no element sibling nodes that come after this one in the document tree.
getNextElementSibling
in interface IElementTraversal
public int getChildElementCount()
Returns the current number of element nodes that are children of this element. 0 if this element has no child nodes that are of nodeType 1.
getChildElementCount
in interface IParentNode
getChildElementCount
in interface IElementTraversal
public HTMLCollection getChildren()
Returns the child elements.
Value: The children.getChildren
in interface IParentNode
public NodeList querySelectorAll(String selector)
Returns a NodeList of all the Elements in document, which match selector
querySelectorAll
in interface IParentNode
selector
- The query selectorHTMLCollection
public Element querySelector(String selector)
Returns the first Element in document, which match selector
querySelector
in interface IParentNode
selector
- The selector.@DOMNameAttribute(name="importNode") public Node importNode(Node importedNode, boolean deep)
Imports a node from another document to this document, without altering or removing the source node from the original document; this method creates a new copy of the source node.
importedNode
- The imported node.deep
- if set to true
[deep].Node
.@DOMNameAttribute(name="xmlStandalone") public boolean getXmlStandalone()
An attribute specifying, as part of the XML declaration, whether this document is standalone. This is false when unspecified.
Value:true
if XML standalone; otherwise, false
.@DOMNameAttribute(name="xmlStandalone") public void setXmlStandalone(boolean value)
An attribute specifying, as part of the XML declaration, whether this document is standalone. This is false when unspecified.
Value:true
if XML standalone; otherwise, false
.@DOMNameAttribute(name="xmlVersion") public String getXmlVersion()
An attribute specifying, as part of the XML declaration, the version number of this document. If there is no declaration and if this document supports the "XML" feature, the value is "1.0". If this document does not support the "XML" feature, the value is always null.
Value: The XML version.@DOMNameAttribute(name="xmlVersion") public void setXmlVersion(String value)
An attribute specifying, as part of the XML declaration, the version number of this document. If there is no declaration and if this document supports the "XML" feature, the value is "1.0". If this document does not support the "XML" feature, the value is always null.
Value: The XML version.@DOMNameAttribute(name="strictErrorChecking") public boolean getStrictErrorChecking()
An attribute specifying whether error checking is enforced or not. When set to false, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise any DOMException on DOM operations or report errors while using Document.normalizeDocument(). In case of error, the behavior is undefined. This attribute is true by default.
Value:true
if strict error checking; otherwise, false
.@DOMNameAttribute(name="strictErrorChecking") public void setStrictErrorChecking(boolean value)
An attribute specifying whether error checking is enforced or not. When set to false, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise any DOMException on DOM operations or report errors while using Document.normalizeDocument(). In case of error, the behavior is undefined. This attribute is true by default.
Value:true
if strict error checking; otherwise, false
.@DOMNameAttribute(name="adoptNode") public Node adoptNode(Node source)
Attempts to adopt a node from another document to this document. https://dom.spec.whatwg.org/#dom-document-adoptnode
source
- The source.public Event createEvent(String eventType)
Creates an Event
of a type supported by the implementation.
createEvent
in interface IDocumentEvent
eventType
- The eventType parameter specifies the type of Event
interface to be created.
Event
interface specified is supported by the implementation this method will
return a new Event
of the interface type requested.
If the Event
is to be dispatched via the IEventTarget.dispatchEvent(com.aspose.html.dom.events.Event)
method the appropriate Event#initEvent(String, boolean, boolean)
method must be called after creation in order to initialize the Event
's values.
The IDocumentEvent.createEvent(String)
method is used in creating Event
s when it is either inconvenient or unnecessary
for the user to create an Event
themselves.
In cases where the implementation provided Event
is insufficient, users may supply
their own Event
implementations for use with the IEventTarget.dispatchEvent(com.aspose.html.dom.events.Event)
method.
Event
DOMException
- NOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Event
interface requested@DOMNameAttribute(name="write") public void write(String... texts)
Write a string of text to a document stream opened by open(). Note that the function will produce a document which is not necessarily driven by a DTD and therefore might be produce an invalid result in the context of the document.
texts
- The string to be parsed into some structure in the
document structure model.@DOMNameAttribute(name="writeln") public void writeLn(String... texts)
Write a string of text followed by a newline character to a document stream opened by open(). Note that the function will produce a document which is not necessarily driven by a DTD and therefore might be produce an invalid result in the context of the document
texts
- The string to be parsed into some structure in the
document structure model.@DOMNameAttribute(name="defaultView") public IWindow getDefaultView()
The defaultView IDL attribute of the Document interface, on getting, must return this Document's browsing context's WindowProxy object, if this Document has an associated browsing context, or null otherwise.
public IXPathExpression createExpression(String expression, IXPathNSResolver resolver)
Creates a parsed XPath expression with resolved namespaces. This is useful when an expression will be reused in an application since it makes it possible to compile the expression string into a more efficient internal form and preresolve all namespace prefixes which occur within the expression.
createExpression
in interface IXPathEvaluator
expression
- The XPath expression string to be parsed.resolver
- The resolver
permits translation of all prefixes,
including the xml
namespace prefix, within the XPath expression into
appropriate namespace URIs. If this is specified as null
, any namespace
prefix within the expression will result in DOMException
being
thrown with the code NAMESPACE_ERR
.DOMException
- INVALID_EXPRESSION_ERR: Raised if the expression is not
legal according to the rules of the IXPathEvaluator
.DOMException
- NAMESPACE_ERR: Raised if the expression contains namespace
prefixes which cannot be resolved by the specified IXPathNSResolver
.public IXPathNSResolver createNSResolver(Node nodeResolver)
Adapts any DOM node to resolve namespaces so that an XPath expression can be easily evaluated
relative to the context of the node where it appeared within the document. This adapter works
like the DOM Level 3 method lookupNamespaceURI
on nodes in resolving the namespaceURI
from a given prefix using the current information available in the node's hierarchy at the time
lookupNamespaceURI is called, also correctly resolving the implicit xml prefix.
createNSResolver
in interface IXPathEvaluator
nodeResolver
- The node to be used as a context for namespace resolution.IXPathNSResolver
which resolves namespaces with respect to the definitions in scope for a specified node.public IXPathResult evaluate(String expression, Node contextNode, IXPathNSResolver resolver, int type, Object result)
Evaluates an XPath expression string and returns a result of the specified type if possible.
evaluate
in interface IXPathEvaluator
expression
- The XPath expression string to be parsed and evaluated.contextNode
- The context is context node for the evaluation of this XPath expression.resolver
- The resolver permits translation of all prefixes, including the xml
namespace prefix, within the XPath expression into appropriate namespace URIs.type
- If a specific type is specified, then the result will be returned as the corresponding type.result
- The result specifies a specific result object which may be reused and returned by this method.public IStyleSheetList getStyleSheets()
A list containing all the style sheets explicitly linked into or embedded in a document. For HTML documents, this includes external style sheets, included via the HTML LINK element, and inline STYLE elements.
getStyleSheets
in interface IDocumentStyle
public com.aspose.html.dom.css.engine.CSSStyleContainer getStyleContainer()
Gets the style container.
Value: The style container.public com.aspose.html.dom.css.engine.CSSStyleDeclaration getComputedStyle(String pseudoElement)
This method is used to get the computed style as it is defined in CSS2.
pseudoElement
- The pseudo element.public void renderTo(IDevice device)
This method is used to render the contents of the current document to a specified graphical device.
device
- The user device.public com.aspose.html.dom.traversal.NodeIterator.NodeIteratorCollection getIterators()
public com.aspose.html.ls.parser.DOMBuilderBase getParser()