com.aspose.html.dom

Class DocumentFragment

  • All Implemented Interfaces:
    IEventTarget, IXPathNSResolver, com.aspose.ms.System.IDisposable


    @DOMObjectAttribute
     @DOMNameAttribute(name="DocumentFragment")
    public class DocumentFragment
    extends Node

    DocumentFragment is a "lightweight" or "minimal" Document object. It is very common to want to be able to extract a portion of a document's tree or to create a new fragment of a document.

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

        public Node cloneNode(boolean deep)

        Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent (parentNode is null) and no user data.

        Specified by:
        cloneNode in class Node
        Parameters:
        deep - if set to true [deep].
        Returns:
        Returns 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.

        Throws:
        com.aspose.ms.System.NotImplementedException - 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.

        Throws:
        com.aspose.ms.System.NotImplementedException - 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.

        Throws:
        com.aspose.ms.System.NotImplementedException - 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.

        Throws:
        com.aspose.ms.System.NotImplementedException - Value: The outer HTML.