Example usage for org.dom4j ProcessingInstruction asXML

List of usage examples for org.dom4j ProcessingInstruction asXML

Introduction

In this page you can find the example usage for org.dom4j ProcessingInstruction asXML.

Prototype

String asXML();

Source Link

Document

asXML returns the textual XML representation of this node.

Usage

From source file:com.cladonia.xml.xdiff.XmlTextNode.java

License:Open Source License

private void parsePI(ProcessingInstruction node) {
    String pi = node.asXML();

    if (pi.startsWith(UPDATEFROM)) {
        updateTextFrom = getUpdatePIValue(pi);
    } else if (pi.startsWith(INSERT)) {
        // check for mixed insert which we treat as a change
        if (pi.equals(MIXED_INSERT)) {
            updateTextFrom = "";
        }//from w w w  . j  av  a  2 s.c o  m
    } else if (pi.startsWith(DELETE)) {
        // check for mixed delete which we treat as a change
        if (pi.indexOf("\"") != -1 && pi.lastIndexOf(MIXED_DELETE_PI_END) != -1) {
            updateTextFrom = getUpdatePIValue(pi);
        }
    }
}

From source file:org.orbeon.oxf.processor.tamino.dom4j.TDOM4JXMLOutputter.java

License:Open Source License

/**
* <p>//w w  w  . j  a v  a2  s  . c  o  m
* This will write the processing instruction to the specified writer.
* </p>
*
* @param comment <code>ProcessingInstruction</code> to write.
* @param out <code>Writer</code> to write to.
* @param indentLevel Current depth in hierarchy.
*/
protected void printProcessingInstruction(ProcessingInstruction pi, Writer out, int indentLevel)
        throws IOException {

    indent(out, indentLevel);
    out.write(pi.asXML());
    maybePrintln(out);

}