Class XmlPI

All Implemented Interfaces:
XMQNode

public class XmlPI extends XmlNode
A processing instruction, eg <?target data?>
  • Constructor Details

    • XmlPI

      public XmlPI(String target, String content)
      Create a processing instruction.
      Parameters:
      target - The pi target.
      content - The pi data, can be null.
  • Method Details

    • type

      public XMQNodeType type()
      Description copied from class: XmlNode
      Returns the type of this node.
      Specified by:
      type in interface XMQNode
      Specified by:
      type in class XmlNode
      Returns:
      The node type.
    • content

      public String content()
      Description copied from class: XmlNode
      Returns the text content of text like nodes (text, cdata, comment, pi). Returns null for other nodes, use XmlNode.textContent() for the concatenated text of an element.
      Specified by:
      content in interface XMQNode
      Overrides:
      content in class XmlNode
      Returns:
      The content or null.
    • setContent

      public void setContent(String content)
      Description copied from class: XmlNode
      Set the content of a text like node. For an element, all children are replaced with a single text node, like libxml2 xmlNodeSetContent.
      Specified by:
      setContent in interface XMQNode
      Overrides:
      setContent in class XmlNode
      Parameters:
      content - The new content.
    • textContent

      public String textContent()
      Description copied from class: XmlNode
      Returns the string value of the node, like libxml2 xmlNodeGetContent. For an element this is the concatenation of all descendant text, where entity references contribute nothing (entities are never expanded implicitly) and character references kept as nodes their character.
      Specified by:
      textContent in interface XMQNode
      Overrides:
      textContent in class XmlNode
      Returns:
      The text content, never null.