List of usage examples for org.dom4j.io SAXWriter setContentHandler
public void setContentHandler(ContentHandler contentHandler)
ContentHandler
called when SAX events are raised From source file:org.dentaku.gentaku.cartridge.event.WerkflowTag.java
License:Apache License
public void doTag(XMLOutput xmlOutput) throws MissingAttributeException, JellyTagException { if (metadataClass == null) { throw new MissingAttributeException("missing metadata attribute"); }// w w w. j a v a 2 s .com try { Document doc = generateDocument(metadataClass); SAXWriter writer = new SAXWriter(); ContentHandler ctxHandler = new WerkflowContentHandler(xmlOutput); writer.setContentHandler(ctxHandler); writer.write(doc); } catch (Exception e) { throw new JellyTagException(e); } }