|
|||||||||
| Home >> All >> org >> jfor >> jfor >> [ tools overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.jfor.jfor.tools
Class DomToSaxAdapter

java.lang.Objectorg.jfor.jfor.tools.ElementVisitor
org.jfor.jfor.tools.DomToSaxAdapter
- public class DomToSaxAdapter
- extends ElementVisitor
Walks a DOM document and fires (some) SAX events to simulate parsing
of the original document.
Written to use jfor with Cocoon 1.8.
Only SAX events that are used by the jfor Converter class are implemented.
Namespace URIs and local names are not implemented.
| Field Summary | |
private org.w3c.dom.Document |
m_doc
|
private org.xml.sax.ContentHandler |
m_handler
|
| Constructor Summary | |
DomToSaxAdapter(org.w3c.dom.Document doc)
create an adapter for the given DOM Document |
|
| Method Summary | |
protected void |
endElement(org.w3c.dom.Element e)
called at the end of the visit of an Element |
private static org.xml.sax.Attributes |
saxAttributes(org.w3c.dom.NamedNodeMap domAttr)
convert DOM attributes to SAX |
void |
simulateParsing(org.xml.sax.ContentHandler ch)
walk the document and send SAX events to the given ContentHandler |
protected void |
startElement(org.w3c.dom.Element e)
called at the start of the visit of an Element |
protected void |
visitCDATA(org.w3c.dom.CDATASection cds)
called to visit a CDATASection node |
protected void |
visitComment(org.w3c.dom.Comment c)
called to visit a Comment node |
protected void |
visitNode(org.w3c.dom.Node n)
called to visit a Node that is not of the other types |
protected void |
visitText(org.w3c.dom.Text t)
called to visit a Text node |
| Methods inherited from class org.jfor.jfor.tools.ElementVisitor |
visit |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
m_handler
private org.xml.sax.ContentHandler m_handler
m_doc
private final org.w3c.dom.Document m_doc
| Constructor Detail |
DomToSaxAdapter
public DomToSaxAdapter(org.w3c.dom.Document doc)
- create an adapter for the given DOM Document
| Method Detail |
simulateParsing
public void simulateParsing(org.xml.sax.ContentHandler ch) throws java.io.IOException, org.xml.sax.SAXException
- walk the document and send SAX events to the given ContentHandler
startElement
protected void startElement(org.w3c.dom.Element e) throws java.io.IOException, org.xml.sax.SAXException
- called at the start of the visit of an Element
- Specified by:
startElementin classElementVisitor
endElement
protected void endElement(org.w3c.dom.Element e) throws java.io.IOException, org.xml.sax.SAXException
- called at the end of the visit of an Element
- Specified by:
endElementin classElementVisitor
visitText
protected void visitText(org.w3c.dom.Text t) throws java.io.IOException, org.xml.sax.SAXException
- called to visit a Text node
- Specified by:
visitTextin classElementVisitor
visitCDATA
protected void visitCDATA(org.w3c.dom.CDATASection cds) throws java.io.IOException
- called to visit a CDATASection node
- Specified by:
visitCDATAin classElementVisitor
visitComment
protected void visitComment(org.w3c.dom.Comment c) throws java.io.IOException
- called to visit a Comment node
- Specified by:
visitCommentin classElementVisitor
visitNode
protected void visitNode(org.w3c.dom.Node n) throws java.io.IOException
- called to visit a Node that is not of the other types
- Specified by:
visitNodein classElementVisitor
saxAttributes
private static org.xml.sax.Attributes saxAttributes(org.w3c.dom.NamedNodeMap domAttr)
- convert DOM attributes to SAX
|
|||||||||
| Home >> All >> org >> jfor >> jfor >> [ tools overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC