Class DOMSender

java.lang.Object
net.sf.saxon.dom.DOMSender

public class DOMSender extends Object
DOMSender.java: pseudo-SAX driver for a DOM source document. This class takes an existing DOM Document and walks around it in a depth-first traversal, calling a Receiver to process the nodes as it does so
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Node
     
    protected String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DOMSender(Node startNode, Receiver receiver)
    Create a DOMSender that will send events representing the nodes in a tree to a nominated receiver
  • Method Summary

    Modifier and Type
    Method
    Description
    While an event is being processed by the receiver, the DOM Node to which it relates is available as the value of currentNode
    void
    Walk a tree (traversing the nodes depth first).
    void
    setSystemId(String systemId)
    Set the systemId of the source document (which will also be used for the destination)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • root

      protected Node root
    • systemId

      protected String systemId
  • Constructor Details

    • DOMSender

      public DOMSender(Node startNode, Receiver receiver)
      Create a DOMSender that will send events representing the nodes in a tree to a nominated receiver
      Parameters:
      startNode - the root node of the tree to be send. Usually a document or element node.
      receiver - the object to be notified of the resulting events. The supplied Receiver must be initialized with a PipelineConfiguration. The caller is responsible for opening and closing the Receiver.
  • Method Details

    • setSystemId

      public void setSystemId(String systemId)
      Set the systemId of the source document (which will also be used for the destination)
      Parameters:
      systemId - the systemId of the source document
    • send

      public void send() throws XPathException
      Walk a tree (traversing the nodes depth first).
      Throws:
      IllegalStateException - if the start node is of a node kind other than document, document fragment, element, text, comment, or processing instruction (for example, if it is an attribute node).
      XPathException - On any error in the document
    • getCurrentNode

      public Node getCurrentNode()
      While an event is being processed by the receiver, the DOM Node to which it relates is available as the value of currentNode
      Returns:
      the node currently being processed by the Receiver