Class DomDocumentFragment

java.lang.Object
org.htmlunit.html.DomNode
org.htmlunit.html.DomDocumentFragment
All Implemented Interfaces:
Serializable, Cloneable, DocumentFragment, Node

public class DomDocumentFragment extends DomNode implements DocumentFragment
A DOM object for DocumentFragment.
See Also:
  • Field Details

  • Constructor Details

    • DomDocumentFragment

      public DomDocumentFragment(SgmlPage page)
      Creates a new instance.
      Parameters:
      page - the page which contains this node
  • Method Details

    • getNodeName

      public String getNodeName()
      Specified by:
      getNodeName in interface Node
      Returns:
      the node name, in this case NODE_NAME
    • getNodeType

      public short getNodeType()
      Specified by:
      getNodeType in interface Node
      Returns:
      the node type constant, in this case Node.DOCUMENT_FRAGMENT_NODE
    • asXml

      public String asXml()
      Returns a string representation as XML document from this element and all it's children (recursively).
      The charset used in the xml header is the current page encoding; but the result is still a string. You have to make sure to use the correct (in fact the same) encoding if you write this to a file.
      This serializes the current state of the DomTree - this implies that the content of noscript tags usually serialized as string because the content is converted during parsing (if js was enabled at that time).
      Overrides:
      asXml in class DomNode
      Returns:
      the XML string
    • isAttachedToPage

      public boolean isAttachedToPage()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Overrides:
      isAttachedToPage in class DomNode
      Returns:
      false
    • setNodeValue

      public void setNodeValue(String value)
      Specified by:
      setNodeValue in interface Node
    • setPrefix

      public void setPrefix(String prefix)
      Specified by:
      setPrefix in interface Node