Example usage for org.w3c.dom ProcessingInstruction getNodeName

List of usage examples for org.w3c.dom ProcessingInstruction getNodeName

Introduction

In this page you can find the example usage for org.w3c.dom ProcessingInstruction getNodeName.

Prototype

public String getNodeName();

Source Link

Document

The name of this node, depending on its type; see the table above.

Usage

From source file:org.dita.dost.reader.ChunkMapReader.java

/**
 * Read processing metadata from processing instructions.
 *///from ww  w  . j  ava2s  . c o m
private void readProcessingInstructions(final Document doc) {
    final NodeList docNodes = doc.getChildNodes();
    for (int i = 0; i < docNodes.getLength(); i++) {
        final Node node = docNodes.item(i);
        if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
            final ProcessingInstruction pi = (ProcessingInstruction) node;
            if (pi.getNodeName().equals(PI_WORKDIR_TARGET)) {
                workdir = pi;
            } else if (pi.getNodeName().equals(PI_WORKDIR_TARGET_URI)) {
                workdirUrl = pi;
            } else if (pi.getNodeName().equals(PI_PATH2PROJ_TARGET)) {
                path2proj = pi;
            } else if (pi.getNodeName().equals(PI_PATH2PROJ_TARGET_URI)) {
                path2projUrl = pi;
            }
        }
    }
}