Code example for Node

Methods: getNodeTypegetUserData

     * @param xmlNode Any node from a document returned by {@link #parseDocument(File, ISdkLog)}. 
     * @return The {@link File} object used to create the document or null. 
    static File extractXmlFilename(@Nullable Node xmlNode) {
        if (xmlNode != null && xmlNode.getNodeType() != Node.DOCUMENT_NODE) {
            xmlNode = xmlNode.getOwnerDocument();
        if (xmlNode != null) {
            Object data = xmlNode.getUserData(DATA_ORIGIN_FILE);
            if (data instanceof File) {
                return (File) data;
        return null; 
     * This is a CRUDE INEXACT HACK to decorate the DOM with some kind of line number 
Experience pair programming with AI  Get Codota for Java