Example usage for javax.xml.transform Result PI_DISABLE_OUTPUT_ESCAPING

List of usage examples for javax.xml.transform Result PI_DISABLE_OUTPUT_ESCAPING

Introduction

In this page you can find the example usage for javax.xml.transform Result PI_DISABLE_OUTPUT_ESCAPING.

Prototype

String PI_DISABLE_OUTPUT_ESCAPING

To view the source code for javax.xml.transform Result PI_DISABLE_OUTPUT_ESCAPING.

Click Source Link

Document

The name of the processing instruction that is sent if the result tree disables output escaping.

Usage

From source file:net.sf.joost.emitter.XmlEmitter.java

/**
 * SAX2-Callback - Outputs a PI//from w w  w  .  jav a 2s  .  c  om
 */
public void processingInstruction(String target, String data) throws SAXException {
    processLastElement(false);

    if (supportDisableOutputEscaping) {
        if (Result.PI_DISABLE_OUTPUT_ESCAPING.equals(target)) {
            disabledOutputEscaping = true;
            return;
        } else if (Result.PI_ENABLE_OUTPUT_ESCAPING.equals(target)) {
            disabledOutputEscaping = false;
            return;
        }
    }

    try {
        writer.write("<?");
        writer.write(target);

        if (!data.equals("")) {
            writer.write(" ");
            writer.write(data);
        }

        writer.write("?>");
    } catch (IOException ex) {
        if (log != null)
            log.error(ex);
        throw new SAXException(ex);
    }
}

From source file:com.ecyrd.jspwiki.parser.JSPWikiMarkupParser.java

/**
 *  Emits a processing instruction that will disable markup escaping. This is
 *  very useful if you want to emit HTML directly into the stream.
 *
 *//*from ww w  . ja v a 2 s.c  o m*/
private void disableOutputEscaping() {
    addElement(new ProcessingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, ""));
}