Java XML Node Value Check isIgnorable(Node n)

Here you can find the source of isIgnorable(Node n)

Description

Can this node be just ignored?

License

Open Source License

Declaration

static public boolean isIgnorable(Node n) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    /** Can this node be just ignored? Empty text nodes can.
     *//*  ww  w.  j a  v  a2 s. c  o m*/
    static public boolean isIgnorable(Node n) {
        int type = n.getNodeType();
        String val = n.getNodeValue();

        return (type == Node.TEXT_NODE && val.trim().length() == 0) || (type == Node.COMMENT_NODE);
    }
}

Related

  1. isEmptyTag(Node p_node)
  2. isEqual(Node a, Node b)
  3. isExpanded(Node node)
  4. isFiltered(Node node)
  5. isHidden(Node node)
  6. isInclude(Node node)
  7. isInlineNode(@Nullable final Node aNode)
  8. isInsertNode(Node n)
  9. isJunk(Node node)