Package org.apache.fop.util
Class DOM2SAX
java.lang.Object
org.apache.fop.util.DOM2SAX
Helper class that produces a SAX stream from a DOM Document.
Part of the code here copied and adapted from Apache Xalan-J, src/org/apache/xalan/xsltc/trax/DOM2SAX.java
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
writeDocument
(Document doc, boolean fragment) Writes the given document using the given ContentHandler.void
writeFragment
(Node node) Writes the given fragment using the given ContentHandler.
-
Constructor Details
-
DOM2SAX
Main constructor- Parameters:
handler
- the ContentHandler to send SAX events to
-
-
Method Details
-
writeDocument
Writes the given document using the given ContentHandler.- Parameters:
doc
- DOM documentfragment
- if false no startDocument() and endDocument() calls are issued.- Throws:
SAXException
- In case of a problem while writing XML
-
writeFragment
Writes the given fragment using the given ContentHandler.- Parameters:
node
- DOM node- Throws:
SAXException
- In case of a problem while writing XML
-