com.aspose.html.dom

Class DocumentFragment

    • Constructor Detail

      • DocumentFragment

        public DocumentFragment(Document ownerDocument)

        Initializes a new instance of the DocumentFragment class.

        Parameters:
        ownerDocument - The owner document.
    • Method Detail

      • 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
      • getInnerHTML

        public String getInnerHTML()

        Returns a fragment of HTML or XML that represents the element's contents. Can be set, to replace the contents of the element with nodes parsed from the given string.

        Value: The inner HTML.
      • setInnerHTML

        public void setInnerHTML(String value)

        Returns a fragment of HTML or XML that represents the element's contents. Can be set, to replace the contents of the element with nodes parsed from the given string.

        Value: The inner HTML.
      • getOuterHTML

        public String getOuterHTML()

        Returns a fragment of HTML or XML that represents the element and its contents. Can be set, to replace the element with nodes parsed from the given string.

        Value: The outer HTML.
      • setOuterHTML

        public void setOuterHTML(String value)

        Returns a fragment of HTML or XML that represents the element and its contents. Can be set, to replace the element with nodes parsed from the given string.

        Value: The outer HTML.
      • getTextContent

        public String getTextContent()

        This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. On setting, any possible children this node may have are removed and, if it the new string is not empty or null, replaced by a single Text node containing the string this attribute is set to.

        Value: The content of the text.
        Overrides:
        getTextContent in class Node
      • setTextContent

        public void setTextContent(String value)

        This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. On setting, any possible children this node may have are removed and, if it the new string is not empty or null, replaced by a single Text node containing the string this attribute is set to.

        Value: The content of the text.
        Overrides:
        setTextContent in class Node
      • getChildren

        public HTMLCollection getChildren()

        Returns the child elements of current element.

        Value: The children collection
        Specified by:
        getChildren in interface IParentNode
      • 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
      • getChildElementCount

        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.

        Value: The child element count.
        Specified by:
        getChildElementCount in interface IParentNode
        Specified by:
        getChildElementCount 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 element