Example usage for org.dom4j.rule Stylesheet run

List of usage examples for org.dom4j.rule Stylesheet run

Introduction

In this page you can find the example usage for org.dom4j.rule Stylesheet run.

Prototype

public void run(Node node) throws Exception 

Source Link

Usage

From source file:org.apache.commons.jelly.tags.jsl.StyleTag.java

License:Apache License

public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
    Stylesheet stylesheet = getStylesheet();
    if (stylesheet == null) {
        throw new MissingAttributeException("stylesheet");
    }/*  w  w  w  .j av a2s  . c  o  m*/

    if (stylesheet instanceof JellyStylesheet) {
        JellyStylesheet jellyStyle = (JellyStylesheet) stylesheet;
        jellyStyle.setOutput(output);
    }

    // dom4j only seems to throw Exception
    try {
        Object source = getSource();
        if (log.isDebugEnabled()) {
            log.debug("About to evaluate stylesheet on source: " + source);
        }

        stylesheet.run(source);
    } catch (Exception e) {
        throw new JellyTagException(e);
    }
}