Example usage for org.w3c.dom Document getNodeType

List of usage examples for org.w3c.dom Document getNodeType

Introduction

In this page you can find the example usage for org.w3c.dom Document getNodeType.

Prototype

public short getNodeType();

Source Link

Document

A code representing the type of the underlying object, as defined above.

Usage

From source file:org.codelibs.robot.transformer.impl.XmlTransformer.java

protected NodeList getNodeList(final Document doc, final String xpath) throws TransformerException {
    final DefaultPrefixResolver prefixResolver = new DefaultPrefixResolver(
            doc.getNodeType() == Node.DOCUMENT_NODE ? doc.getDocumentElement() : doc);
    return getXPathAPI().eval(doc, xpath, prefixResolver).nodelist();
}