List of utility methods to do XML Node Value
String | getValue(Node node) get Value StringBuffer value = new StringBuffer(); if (node != null) { int childCount = node.getChildNodes().getLength(); for (int i = 0; i < childCount; i++) { Node childNode = node.getChildNodes().item(i); switch (childNode.getNodeType()) { case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: ... |
String | getValue(Node node) get Value if (node == null) { return null; return getValue(node.getTextContent()); |
String | getValue(Node node) get Value String val = ""; if (node != null) { if (node instanceof Element) { val = node.getTextContent(); } else if (node instanceof Attr) { val = ((Attr) node).getValue(); } else { val = node.getNodeValue(); ... |
String | getValue(Node node) Get the value of a node. NodeList children = node.getChildNodes(); if (children.getLength() == 0) { return ""; return children.item(0).getNodeValue(); |
String | getValue(Node node, short nodeType) get Value switch (nodeType) { case Node.ELEMENT_NODE: return ((Element) node).getTagName(); case Node.TEXT_NODE: return ((Text) node).getData(); case Node.PROCESSING_INSTRUCTION_NODE: return ((ProcessingInstruction) node).getData(); default: ... |
String | getValue(Node node, short nodeType) get Value switch (nodeType) { case Node.ELEMENT_NODE: return ((Element) node).getTagName(); case Node.TEXT_NODE: return ((Text) node).getData(); case Node.PROCESSING_INSTRUCTION_NODE: return ((ProcessingInstruction) node).getData(); default: ... |
String | getValue(Node node, short nodeType) get Value switch (nodeType) { case Node.ELEMENT_NODE: return ((Element) node).getTagName(); case Node.TEXT_NODE: return ((Text) node).getData(); case Node.PROCESSING_INSTRUCTION_NODE: return ((ProcessingInstruction) node).getData(); default: ... |
String | getValue(Node node, String Tag) Get Value from XML if (node == null) return ""; NodeList nl = ((Element) node).getElementsByTagName(Tag); if (nl == null) return ""; Element el = (Element) nl.item(0); if (el == null) return ""; ... |
String | getValue(Node pNode) returns a XML node value. String s = null; try { NodeList nodes = pNode.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { s = ((Node) nodes.item(i)).getNodeValue().trim(); if (s.equals("") || s.equals("\r")) continue; } catch (Exception ex) { throw new Exception(ex.getMessage()); return s; |
String | getValueByElement(Node node) get Value By Element List<Node> ref_nodes = getChildRefNode(node); if (ref_nodes.size() == 1) { Node define_node = getDefineRefByName(getRefName(ref_nodes.get(0)), node.getOwnerDocument()); return getValueByElement(define_node); } else if (getNodeValue(node) != null) { return getNodeValue(node).getTextContent(); } else { return ""; ... |