org.apache.cocoon.xml.dom
Class DOMStreamer

java.lang.Object
  extended by org.apache.cocoon.xml.dom.DOMStreamer

public class DOMStreamer
extends Object

The DOMStreamer is a utility class that will generate SAX events from a W3C DOM Document.

The DOMStreamer uses a different strategy based on the value of the normalizeNamespaces property:

Version:
$Id: DOMStreamer.java 729283 2008-12-24 09:25:21Z cziegeler $

Nested Class Summary
static class DOMStreamer.DefaultDOMStreamer
          The DefaultDOMStreamer is a utility class that will generate SAX events from a W3C DOM Document.
static class DOMStreamer.NamespaceNormalizingDOMStreamer
          Streams a DOM tree to SAX events and normalizes namespace declarations on the way.
 
Field Summary
protected  DOMStreamer.DefaultDOMStreamer defaultDOMStreamer
          DOMStreamer used when namespace normalization should not explicitely happen.
protected  DOMStreamer.NamespaceNormalizingDOMStreamer namespaceNormalizingDOMStreamer
          DOMStreamer used in case of namespace normalization.
protected  boolean normalizeNamespaces
          Indicates whether namespace normalization should happen.
 
Constructor Summary
DOMStreamer()
          Create a new DOMStreamer instance.
DOMStreamer(ContentHandler content)
          Create a new DOMStreamer instance.
 
Method Summary
 boolean isNormalizeNamespaces()
           
 void recycle()
           
 void setContentHandler(ContentHandler handler)
          Set the ContentHandler that will receive XML data.
 void setNormalizeNamespaces(boolean normalizeNamespaces)
           
 void stream(Node node)
          Start the production of SAX events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

normalizeNamespaces

protected boolean normalizeNamespaces
Indicates whether namespace normalization should happen.


namespaceNormalizingDOMStreamer

protected DOMStreamer.NamespaceNormalizingDOMStreamer namespaceNormalizingDOMStreamer
DOMStreamer used in case of namespace normalization.


defaultDOMStreamer

protected DOMStreamer.DefaultDOMStreamer defaultDOMStreamer
DOMStreamer used when namespace normalization should not explicitely happen.

Constructor Detail

DOMStreamer

public DOMStreamer()
Create a new DOMStreamer instance.


DOMStreamer

public DOMStreamer(ContentHandler content)
Create a new DOMStreamer instance.

Method Detail

setContentHandler

public void setContentHandler(ContentHandler handler)
Set the ContentHandler that will receive XML data.


stream

public void stream(Node node)
            throws SAXException
Start the production of SAX events.

Throws:
SAXException

isNormalizeNamespaces

public boolean isNormalizeNamespaces()

setNormalizeNamespaces

public void setNormalizeNamespaces(boolean normalizeNamespaces)

recycle

public void recycle()


Copyright © 1999-2009 The Apache Software Foundation. All Rights Reserved.