Example usage for org.dom4j ProcessingInstruction getName

List of usage examples for org.dom4j ProcessingInstruction getName

Introduction

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

Prototype

String getName();

Source Link

Document

getName returns the name of this node.

Usage

From source file:architecture.common.xml.XmlWriter.java

License:Apache License

protected void writeProcessingInstruction(ProcessingInstruction processingInstruction) throws IOException {
    // indent();/*from  w w  w  .  ja  va  2s.co m*/
    writer.write("<?");
    writer.write(processingInstruction.getName());
    writer.write(" ");
    writer.write(processingInstruction.getText());
    writer.write("?>");
    writePrintln();

    lastOutputNodeType = Node.PROCESSING_INSTRUCTION_NODE;
}

From source file:architecture.ee.util.xml.XmlWriter.java

License:Apache License

protected void writeProcessingInstruction(ProcessingInstruction processingInstruction) throws IOException {
    //indent();/*from  w  w w  .jav  a2  s.com*/
    writer.write("<?");
    writer.write(processingInstruction.getName());
    writer.write(" ");
    writer.write(processingInstruction.getText());
    writer.write("?>");
    writePrintln();

    lastOutputNodeType = Node.PROCESSING_INSTRUCTION_NODE;
}

From source file:com.itextpdf.rups.view.itext.treenodes.XdpTreeNode.java

License:Open Source License

@Override
public String toString() {
    Node node = getNode();//w w  w .  j a  v  a2 s  .  c  o m
    if (node instanceof Element) {
        Element e = (Element) node;
        return e.getName();
    }
    if (node instanceof Attribute) {
        Attribute a = (Attribute) node;
        StringBuffer buf = new StringBuffer();
        buf.append(a.getName());
        buf.append("=\"");
        buf.append(a.getValue());
        buf.append('"');
        return buf.toString();
    }
    if (node instanceof Text) {
        Text t = (Text) node;
        return t.getText();
    }
    if (node instanceof ProcessingInstruction) {
        ProcessingInstruction pi = (ProcessingInstruction) node;
        StringBuffer buf = new StringBuffer("<?");
        buf.append(pi.getName());
        buf.append(' ');
        buf.append(pi.getText());
        buf.append("?>");
        return buf.toString();
    }
    if (node instanceof Document) {
        return "XFA Document";
    }
    return getNode().toString();
}

From source file:com.lowagie.rups.view.itext.treenodes.XdpTreeNode.java

License:Open Source License

public String toString() {
    Node node = getNode();/*w  ww  . jav  a 2s  .co m*/
    if (node instanceof Element) {
        Element e = (Element) node;
        return e.getName();
    }
    if (node instanceof Attribute) {
        Attribute a = (Attribute) node;
        StringBuffer buf = new StringBuffer();
        buf.append(a.getName());
        buf.append("=\"");
        buf.append(a.getValue());
        buf.append('"');
        return buf.toString();
    }
    if (node instanceof Text) {
        Text t = (Text) node;
        return t.getText();
    }
    if (node instanceof ProcessingInstruction) {
        ProcessingInstruction pi = (ProcessingInstruction) node;
        StringBuffer buf = new StringBuffer("<?");
        buf.append(pi.getName());
        buf.append(' ');
        buf.append(pi.getText());
        buf.append("?>");
        return buf.toString();
    }
    if (node instanceof Document) {
        return "XFA Document";
    }
    return getNode().toString();
}