List of utility methods to do XML Node Value Check
boolean | isExpanded(Node node) is Expanded return expandedComboBoxes.containsKey(node);
|
boolean | isFiltered(Node node) is Filtered short type = node.getNodeType(); String name = node.getNodeName(); if (type == 8) return true; if (name.equals("SCRIPT")) return true; if (name.equals("LINK")) return true; ... |
boolean | isHidden(Node node) is Hidden if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) return ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) node).getReadOnly(); else if (node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl) return ((com.sun.org.apache.xerces.internal.dom.NodeImpl) node).getReadOnly(); return false; |
boolean | isIgnorable(Node n) Can this node be just ignored? int type = n.getNodeType(); String val = n.getNodeValue(); return (type == Node.TEXT_NODE && val.trim().length() == 0) || (type == Node.COMMENT_NODE); |
boolean | isInclude(Node node) is Include if (node != null && node.getNodeType() == Node.ELEMENT_NODE) { return node.getNodeName().indexOf("jsp:include") >= 0 || node.getNodeName().indexOf("jsp:directive.include") >= 0; return false; |
boolean | isInlineNode(@Nullable final Node aNode) Check if the passed node is a text node. return aNode instanceof Text || aNode instanceof EntityReference; |
boolean | isInsertNode(Node n) is Insert Node return n.getNodeName().equals("insert"); |
boolean | isJunk(Node node) is Junk if (node.getNodeType() == Node.COMMENT_NODE) { return true; if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { return true; if (node.getNodeType() == Node.TEXT_NODE) { Text text = (Text) node; ... |
boolean | isLeaf(Node node) Check if the node is a leaf node (with no child elements). NodeList nodeList = node.getChildNodes(); if (nodeList.getLength() == 0) { return true; for (int i = 0; i < nodeList.getLength(); i++) { if (nodeList.item(i) instanceof Element) { return false; return true; |
boolean | isMixed(org.w3c.dom.Node node) is Mixed boolean retval = false; if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) { retval = ((org.w3c.dom.Element) node).getAttribute("mixed").equals("true"); return retval; |