Java Code Examples for org.w3c.dom.ProcessingInstruction#getNodeName()

The following examples show how to use org.w3c.dom.ProcessingInstruction#getNodeName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DOM3TreeWalker.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Serializes an ProcessingInstruction Node.
 *
 * @param node The ProcessingInstruction Node to serialize
 */
protected void serializePI(ProcessingInstruction node)
    throws SAXException {
    ProcessingInstruction pi = node;
    String name = pi.getNodeName();

    // well-formed=true
    if ((fFeatures & WELLFORMED) != 0) {
        isPIWellFormed(node);
    }

    // apply the LSSerializer filter
    if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) {
        return;
    }

    // String data = pi.getData();
    if (name.equals("xslt-next-is-raw")) {
        fNextIsRaw = true;
    } else {
        this.fSerializer.processingInstruction(name, pi.getData());
    }
}
 
Example 2
Source File: DOM3TreeWalker.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Serializes an ProcessingInstruction Node.
 *
 * @param node The ProcessingInstruction Node to serialize
 */
protected void serializePI(ProcessingInstruction node)
    throws SAXException {
    ProcessingInstruction pi = node;
    String name = pi.getNodeName();

    // well-formed=true
    if ((fFeatures & WELLFORMED) != 0) {
        isPIWellFormed(node);
    }

    // apply the LSSerializer filter
    if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) {
        return;
    }

    // String data = pi.getData();
    if (name.equals("xslt-next-is-raw")) {
        fNextIsRaw = true;
    } else {
        this.fSerializer.processingInstruction(name, pi.getData());
    }
}
 
Example 3
Source File: DOM3TreeWalker.java    From j2objc with Apache License 2.0 6 votes vote down vote up
/**
 * Serializes an ProcessingInstruction Node.
 * 
 * @param node The ProcessingInstruction Node to serialize
 */
protected void serializePI(ProcessingInstruction node)
    throws SAXException {
    ProcessingInstruction pi = node;
    String name = pi.getNodeName();

    // well-formed=true
    if ((fFeatures & WELLFORMED) != 0) {
        isPIWellFormed(node);
    }

    // apply the LSSerializer filter
    if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) {
        return;
    }

    // String data = pi.getData();
    if (name.equals("xslt-next-is-raw")) {
        fNextIsRaw = true;
    } else {
        this.fSerializer.processingInstruction(name, pi.getData());
    }
}