com.aspose.html.dom

Class Document

    • Field Detail

      • revision

        public long revision
      • strCDataSectionName

        public String strCDataSectionName
      • strCommentName

        public String strCommentName
      • strDocumentFragmentName

        public String strDocumentFragmentName
      • strDocumentName

        public String strDocumentName
      • strEntityName

        public String strEntityName
      • strTextName

        public String strTextName
      • strReservedXml

        public String strReservedXml
      • strReservedXmlns

        public String strReservedXmlns
      • strReservedXhtmlns

        public String strReservedXhtmlns
      • strSignificantWhitespaceName

        public String strSignificantWhitespaceName
      • strSpace

        public String strSpace
      • strXml

        public String strXml
      • strXmlns

        public String strXmlns
      • PendingRarsingBlockingScript

        public com.aspose.html.dom.runtime.modules.ILinkScript PendingRarsingBlockingScript
      • CurrentScript

        public com.aspose.html.dom.runtime.modules.ILinkScript CurrentScript
      • IgnoreDestructiveWritesCounter

        public int IgnoreDestructiveWritesCounter
      • OnReadyStateChangeDelegate

        public DOMEventHandler OnReadyStateChangeDelegate

        Gets or sets event handler for OnReadyStateChange event.

      • OnReadyStateChange

        public com.aspose.ms.lang.Event<DOMEventHandler> OnReadyStateChange
      • OnAbortDelegate

        public DOMEventHandler OnAbortDelegate

        Gets or sets event handler for OnAbort event.

      • OnBlurDelegate

        public DOMEventHandler OnBlurDelegate

        Gets or sets event handler for OnBlur event.

      • OnCancelDelegate

        public DOMEventHandler OnCancelDelegate

        Gets or sets event handler for OnCancel event.

      • OnCanplayDelegate

        public DOMEventHandler OnCanplayDelegate

        Gets or sets event handler for OnCanplay event.

      • OnCanPlayThroughDelegate

        public DOMEventHandler OnCanPlayThroughDelegate

        Gets or sets event handler for OnCanPlayThrough event.

      • OnCanPlayThrough

        public com.aspose.ms.lang.Event<DOMEventHandler> OnCanPlayThrough
      • OnChangeDelegate

        public DOMEventHandler OnChangeDelegate

        Gets or sets event handler for OnChange event.

      • OnClickDelegate

        public DOMEventHandler OnClickDelegate

        Gets or sets event handler for OnClick event.

      • OnCueChangeDelegate

        public DOMEventHandler OnCueChangeDelegate

        Gets or sets event handler for OnCueChange event.

      • OnCueChange

        public com.aspose.ms.lang.Event<DOMEventHandler> OnCueChange
      • OnDblClickDelegate

        public DOMEventHandler OnDblClickDelegate

        Gets or sets event handler for OnDblClick event.

      • OnDurationChangeDelegate

        public DOMEventHandler OnDurationChangeDelegate

        Gets or sets event handler for OnDurationChange event.

      • OnDurationChange

        public com.aspose.ms.lang.Event<DOMEventHandler> OnDurationChange
      • OnEmptiedDelegate

        public DOMEventHandler OnEmptiedDelegate

        Gets or sets event handler for OnEmptied event.

      • OnEndedDelegate

        public DOMEventHandler OnEndedDelegate

        Gets or sets event handler for OnEnded event.

      • OnErrorDelegate

        public DOMEventHandler OnErrorDelegate

        Gets or sets event handler for OnError event.

      • OnFocusDelegate

        public DOMEventHandler OnFocusDelegate

        Gets or sets event handler for OnFocus event.

      • OnInputDelegate

        public DOMEventHandler OnInputDelegate

        Gets or sets event handler for OnInput event.

      • OnInvalidDelegate

        public DOMEventHandler OnInvalidDelegate

        Gets or sets event handler for OnInvalid event.

      • OnKeyDownDelegate

        public DOMEventHandler OnKeyDownDelegate

        Gets or sets event handler for OnKeyDown event.

      • OnKeyPressDelegate

        public DOMEventHandler OnKeyPressDelegate

        Gets or sets event handler for OnKeyPress event.

      • OnKeyUpDelegate

        public DOMEventHandler OnKeyUpDelegate

        Gets or sets event handler for OnKeyUp event.

      • OnLoadDelegate

        public DOMEventHandler OnLoadDelegate

        Gets or sets event handler for OnLoad event.

      • OnLoadedDataDelegate

        public DOMEventHandler OnLoadedDataDelegate

        Gets or sets event handler for OnLoadedData event.

      • OnLoadedData

        public com.aspose.ms.lang.Event<DOMEventHandler> OnLoadedData
      • OnLoadedMetadataDelegate

        public DOMEventHandler OnLoadedMetadataDelegate

        Gets or sets event handler for OnLoadedMetadata event.

      • OnLoadedMetadata

        public com.aspose.ms.lang.Event<DOMEventHandler> OnLoadedMetadata
      • OnLoadStartDelegate

        public DOMEventHandler OnLoadStartDelegate

        Gets or sets event handler for OnLoadStart event.

      • OnLoadStart

        public com.aspose.ms.lang.Event<DOMEventHandler> OnLoadStart
      • OnMouseDownDelegate

        public DOMEventHandler OnMouseDownDelegate

        Gets or sets event handler for OnMouseDown event.

      • OnMouseDown

        public com.aspose.ms.lang.Event<DOMEventHandler> OnMouseDown
      • OnMouseEnterDelegate

        public DOMEventHandler OnMouseEnterDelegate

        Gets or sets event handler for OnMouseEnter event.

      • OnMouseEnter

        public com.aspose.ms.lang.Event<DOMEventHandler> OnMouseEnter
      • OnMouseLeaveDelegate

        public DOMEventHandler OnMouseLeaveDelegate

        Gets or sets event handler for OnMouseLeave event.

      • OnMouseLeave

        public com.aspose.ms.lang.Event<DOMEventHandler> OnMouseLeave
      • OnMouseMoveDelegate

        public DOMEventHandler OnMouseMoveDelegate

        Gets or sets event handler for OnMouseMove event.

      • OnMouseMove

        public com.aspose.ms.lang.Event<DOMEventHandler> OnMouseMove
      • OnMouseOutDelegate

        public DOMEventHandler OnMouseOutDelegate

        Gets or sets event handler for OnMouseOut event.

      • OnMouseOverDelegate

        public DOMEventHandler OnMouseOverDelegate

        Gets or sets event handler for OnMouseOver event.

      • OnMouseOver

        public com.aspose.ms.lang.Event<DOMEventHandler> OnMouseOver
      • OnMouseUpDelegate

        public DOMEventHandler OnMouseUpDelegate

        Gets or sets event handler for OnMouseUp event.

      • OnMouseWheelDelegate

        public DOMEventHandler OnMouseWheelDelegate

        Gets or sets event handler for OnMouseWheel event.

      • OnMouseWheel

        public com.aspose.ms.lang.Event<DOMEventHandler> OnMouseWheel
      • OnPauseDelegate

        public DOMEventHandler OnPauseDelegate

        Gets or sets event handler for OnPause event.

      • OnPlayDelegate

        public DOMEventHandler OnPlayDelegate

        Gets or sets event handler for OnPlay event.

      • OnPlayingDelegate

        public DOMEventHandler OnPlayingDelegate

        Gets or sets event handler for OnPlaying event.

      • OnProgressDelegate

        public DOMEventHandler OnProgressDelegate

        Gets or sets event handler for OnProgress event.

      • OnRateChangeDelegate

        public DOMEventHandler OnRateChangeDelegate

        Gets or sets event handler for OnRateChange event.

      • OnRateChange

        public com.aspose.ms.lang.Event<DOMEventHandler> OnRateChange
      • OnResetDelegate

        public DOMEventHandler OnResetDelegate

        Gets or sets event handler for OnReset event.

      • OnResizeDelegate

        public DOMEventHandler OnResizeDelegate

        Gets or sets event handler for OnResize event.

      • OnScrollDelegate

        public DOMEventHandler OnScrollDelegate

        Gets or sets event handler for OnScroll event.

      • OnSeekedDelegate

        public DOMEventHandler OnSeekedDelegate

        Gets or sets event handler for OnSeeked event.

      • OnSeekingDelegate

        public DOMEventHandler OnSeekingDelegate

        Gets or sets event handler for OnSeeking event.

      • OnSelectDelegate

        public DOMEventHandler OnSelectDelegate

        Gets or sets event handler for OnSelect event.

      • OnShowDelegate

        public DOMEventHandler OnShowDelegate

        Gets or sets event handler for OnShow event.

      • OnStalledDelegate

        public DOMEventHandler OnStalledDelegate

        Gets or sets event handler for OnStalled event.

      • OnSubmitDelegate

        public DOMEventHandler OnSubmitDelegate

        Gets or sets event handler for OnSubmit event.

      • OnSuspendDelegate

        public DOMEventHandler OnSuspendDelegate

        Gets or sets event handler for OnSuspend event.

      • OnTimeUpdateDelegate

        public DOMEventHandler OnTimeUpdateDelegate

        Gets or sets event handler for OnTimeUpdate event.

      • OnTimeUpdate

        public com.aspose.ms.lang.Event<DOMEventHandler> OnTimeUpdate
      • OnToggleDelegate

        public DOMEventHandler OnToggleDelegate

        Gets or sets event handler for OnToggle event.

      • OnVolumeChangeDelegate

        public DOMEventHandler OnVolumeChangeDelegate

        Gets or sets event handler for OnVolumeChange event.

      • OnVolumeChange

        public com.aspose.ms.lang.Event<DOMEventHandler> OnVolumeChange
      • OnWaitingDelegate

        public DOMEventHandler OnWaitingDelegate

        Gets or sets event handler for OnWaiting event.

    • Constructor Detail

      • Document

        public Document(com.aspose.html.BrowsingContext context)

        Initializes a new instance of the Document class.

        Parameters:
        context - The browsing context.
    • Method Detail

      • navigate

        public void navigate(String address)

        Loads the document at the specified Uniform Resource Locator (URL) into the current instance, replacing the previous content.

        Parameters:
        address - The document address.
      • navigate

        public void navigate(Url url)

        Loads the document at the specified Uniform Resource Locator (URL) into the current instance, replacing the previous content.

        Parameters:
        url - The document URL.
      • navigate

        public void navigate(String content,
                             String baseUri)

        Loads the document from specified content and using baseUri to resolve relative resources, replacing the previous content.

        Parameters:
        content - The document content.
        baseUri - The base URI to resolve relative resources.
        Throws:
        com.aspose.ms.System.ArgumentNullException - baseUri is null.
      • navigate

        public void navigate(com.aspose.ms.System.IO.Stream content,
                             String baseUri)

        Loads the document from specified content and using baseUri to resolve relative resources, replacing the previous content.

        Parameters:
        content - The document content.
        baseUri - The base URI to resolve relative resources.
        Throws:
        com.aspose.ms.System.ArgumentNullException - baseUri is null.
      • navigate

        public void navigate(RequestMessage request)

        Loads the document based on specified request object, replacing the previous content.

        Parameters:
        request - The request object that is used to load document content.
      • navigate

        public void navigate(ResponseMessage response,
                             byte flags)

        Loads the document based on specified response object, replacing the previous content.

        Parameters:
        response - The request object that is used to load document content.
      • getCookies

        public com.aspose.ms.System.Net.CookieContainer getCookies()
      • getNameTable

        public com.aspose.ms.System.Xml.XmlNameTable getNameTable()

        Gets the XmlNameTable associated with this implementation.

      • getOwnerDocument

        public Document getOwnerDocument()

        Gets the owner document.

        Value: The owner document.
        Overrides:
        getOwnerDocument in class Node
      • getContext

        public IBrowsingContext getContext()

        Gets the current browsing context.

        Value: The context.
      • getBrowsingContext

        public com.aspose.html.BrowsingContext getBrowsingContext()

        Gets the current browsing context as a internal object.

        Value: The browsing context.
      • getLocation

        public Location getLocation()

        The location of the document.

        Value: The location.
      • setLocation

        public void setLocation(Location value)

        The location of the document.

        Value: The location.
      • getDocumentURI

        @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.
      • getBaseURI

        public String getBaseURI()

        The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI.

        Overrides:
        getBaseURI in class Node
      • getNodeName

        public String getNodeName()

        The name of this node, depending on its type.

        Value: The name of the node.
        Specified by:
        getNodeName in class Node
      • getNodeType

        public int getNodeType()

        A code representing the type of the underlying object.

        Value: The type of the node.
        Specified by:
        getNodeType in class Node
      • getQuirksMode

        public byte getQuirksMode()
      • setQuirksMode

        public void setQuirksMode(byte value)
      • getCharacterSet

        @DOMNameAttribute(name="characterSet")
        public String getCharacterSet()

        Gets the document's encoding.

        Value: The document's encoding.
      • getCharset

        @DOMNameAttribute(name="charset")
        public String getCharset()

        Gets the document's encoding.

        Value: The document's encoding.
      • getInputEncoding

        @DOMNameAttribute(name="inputEncoding")
        public String getInputEncoding()

        Gets the document's encoding.

        Value: The document's encoding.
      • getContentType

        @DOMNameAttribute(name="contentType")
        public String getContentType()

        Gets the document content type.

        Value: The type of the content.
      • setContentType

        @DOMNameAttribute(name="contentType")
        public void setContentType(String value)

        Gets the document content type.

        Value: The type of the content.
      • getReadyState

        @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.

      • setReadyState

        @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.

      • getMimeType

        public MimeType getMimeType()
      • getDocumentElement

        @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.
      • createElement

        @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.

        Parameters:
        localName - Name of the tag.
        Returns:
        The Element.
      • createElementNS

        @DOMNameAttribute(name="createElementNS")
        public Element createElementNS(String namespaceURI,
                                                                                  String qualifiedName)

        Creates an element of the given qualified name and namespace URI.

        Parameters:
        namespaceURI - The namespace URI.
        qualifiedName - Name of the qualified.
        Returns:
        The Element.
      • createTextNode

        @DOMNameAttribute(name="createTextNode")
        public Text createTextNode(String data)

        Creates a Text node given the specified string.

        Parameters:
        data - The text data.
        Returns:
        The Text.
      • createComment

        @DOMNameAttribute(name="createComment")
        public Comment createComment(String data)

        Creates a Comment node given the specified string.

        Parameters:
        data - The comment data.
        Returns:
        The Comment.
      • createAttribute

        @DOMNameAttribute(name="createAttribute")
        public Attr createAttribute(String localName)

        Creates an Attr of the given name.

        Parameters:
        localName - The attribute name.
        Returns:
        The Attr.
      • createAttributeNS

        @DOMNameAttribute(name="createAttributeNS")
        public Attr createAttributeNS(String namespaceURI,
                                                                                   String qualifiedName)

        Creates an attribute of the given qualified name and namespace URI.

        Parameters:
        namespaceURI - The namespace URI.
        qualifiedName - Name of the qualified.
        Returns:
        The Attr.
      • createEntityReference

        @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.

        Parameters:
        name - The entity name.
        Returns:
        The EntityReference.
      • createDocumentType

        @DOMNameAttribute(name="createDocumentType")
        public DocumentType createDocumentType(String name,
                                                                                             String publicId,
                                                                                             String systemId,
                                                                                             String internalSubset)

        Creates a DocumentType node.

        Parameters:
        name - The document type name.
        publicId - The public id.
        systemId - The system id.
        internalSubset - The internal subset.
        Returns:
        The DocumentType.
      • getElementsByTagName

        @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.

        Parameters:
        tagname - The tagname.
        Returns:
        Returns nodes.
      • getElementsByTagNameNS

        @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.

        Parameters:
        namespaceURI - The namespace URI.
        localName - Name of the local.
        Returns:
        Returns nodes
      • getElementById

        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.

        Specified by:
        getElementById in interface INonElementParentNode
        Parameters:
        elementId - The element id.
        Returns:
        The Element.
      • getElementsByClassName

        @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/

        Parameters:
        classNames - The string string that contains an unordered set of unique space-separated tokens representing classes (class names)
        Returns:
        The Element.
      • createNodeIterator

        public INodeIterator createNodeIterator(Node root,
                                                long whatToShow,
                                                INodeFilter filter)

        Create a new NodeIterator over the subtree rooted at the specified node.

        Specified by:
        createNodeIterator in interface IDocumentTraversal
        Parameters:
        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.
        Returns:
        The newly created NodeIterator.
        Throws:
        DOMException - NOT_SUPPORTED_ERR: Raised if the specified root is null.
      • createTreeWalker

        public ITreeWalker createTreeWalker(Node root,
                                            long whatToShow,
                                            INodeFilter filter)

        Create a new TreeWalker over the subtree rooted at the specified node.

        Specified by:
        createTreeWalker in interface IDocumentTraversal
        Parameters:
        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.
        Returns:
        The newly created TreeWalker.
        Throws:
        DOMException - NOT_SUPPORTED_ERR: Raised if the specified root is null.
      • getPreviousElementSibling

        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.

        Specified by:
        getPreviousElementSibling in interface IElementTraversal
      • getNextElementSibling

        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.

        Specified by:
        getNextElementSibling in interface IElementTraversal
      • querySelector

        public Element querySelector(String selector)

        Returns the first Element in document, which match selector

        Specified by:
        querySelector in interface IParentNode
        Parameters:
        selector - The selector.
        Returns:
        The matched node.
      • importNode

        @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.

        Parameters:
        importedNode - The imported node.
        deep - if set to true [deep].
        Returns:
        The Node.
      • getXmlStandalone

        @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.
      • setXmlStandalone

        @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.
      • getXmlVersion

        @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.
      • setXmlVersion

        @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.
      • getStrictErrorChecking

        @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.
      • setStrictErrorChecking

        @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.
      • adoptNode

        @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

        Parameters:
        source - The source.
        Returns:
        Adopted node
      • createEvent

        public Event createEvent(String eventType)

        Creates an Event of a type supported by the implementation.

        Specified by:
        createEvent in interface IDocumentEvent
        Parameters:
        eventType - The eventType parameter specifies the type of Event interface to be created.


        If the 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 Events 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.

        Returns:
        The newly created Event
        Throws:
        DOMException - NOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Event interface requested
      • write

        @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.

        Parameters:
        texts - The string to be parsed into some structure in the document structure model.
      • writeLn

        @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

        Parameters:
        texts - The string to be parsed into some structure in the document structure model.
      • getDefaultView

        @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.

      • createExpression

        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.

        Specified by:
        createExpression in interface IXPathEvaluator
        Parameters:
        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.
        Returns:
        The compiled form of the XPath expression.
        Throws:
        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.
      • createNSResolver

        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.

        Specified by:
        createNSResolver in interface IXPathEvaluator
        Parameters:
        nodeResolver - The node to be used as a context for namespace resolution.
        Returns:
        IXPathNSResolver which resolves namespaces with respect to the definitions in scope for a specified node.
      • evaluate

        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.

        Specified by:
        evaluate in interface IXPathEvaluator
        Parameters:
        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.
        Returns:
        The result of the evaluation of the XPath expression.
      • getStyleSheets

        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.

        Specified by:
        getStyleSheets in interface IDocumentStyle
      • getStyleContainer

        public com.aspose.html.dom.css.engine.CSSStyleContainer getStyleContainer()

        Gets the style container.

        Value: The style container.
      • getComputedStyle

        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.

        Parameters:
        pseudoElement - The pseudo element.
        Returns:
        The computed style
      • renderTo

        public void renderTo(IDevice device)

        This method is used to render the contents of the current document to a specified graphical device.

        Parameters:
        device - The user device.
      • getIterators

        public com.aspose.html.dom.traversal.NodeIterator.NodeIteratorCollection getIterators()
      • getParser

        public com.aspose.html.ls.parser.DOMBuilderBase getParser()