Example usage for org.dom4j.io SAXWriter SAXWriter

List of usage examples for org.dom4j.io SAXWriter SAXWriter

Introduction

In this page you can find the example usage for org.dom4j.io SAXWriter SAXWriter.

Prototype

public SAXWriter() 

Source Link

Usage

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");
    }/* ww  w.j a va  2  s . c om*/
    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);
    }
}