List of utility methods to do XML Node Path
String | getNodesPathName(Node node) Returns the path expression for a given node. final StringBuffer buffer = new StringBuffer(); buildNodeName(node, buffer); return buffer.toString(); |
Node | getNXInfo(Node xmlDoc, String NXclassPath, String NXclassNameList, String fieldName, String filename) Finds information in an XML document if (xmlDoc == null) return null; NXclassPath = standardize_dot_sep_list(NXclassPath); NXclassNameList = standardize_dot_sep_list(NXclassNameList); if (filename != null && filename.length() < 1) filename = null; if (fieldName != null && fieldName.length() < 1) fieldName = null; ... |
Node | getNXInfo1(Node xmlDoc, String NXclassPath, String NXclassNameList, String fieldName, String filename) Finds information in an XML document if (xmlDoc == null) return null; NXclassPath = standardize_dot_sep_list(NXclassPath); NXclassNameList = standardize_dot_sep_list(NXclassNameList); if (filename != null && filename.length() < 1) filename = null; NodeList children = xmlDoc.getChildNodes(); if (children.getLength() == 1) ... |
Node | getNXInfoDefault(Node xmlDoc, String NXclassPath, String NXclassNameList, String fieldName, String filename) Same as getNXInfo except that It checks general first( NXclassNameList is "") then repeatedly add elements of the NXclassNameList and/or field name , then does the same with the runs node if (NXclassPath == null) return null; if (xmlDoc == null) return null; NXclassNameList = standardize_dot_sep_list(NXclassNameList); fieldName = standardize_dot_sep_list(fieldName); Node N = getNXInfo(xmlDoc, NXclassPath, "", fieldName, ""); int i = 1; ... |
String | getPath(Node n) get Path String path = ""; while (n != null) { path = "/" + getPathElement(n) + path; n = getParent(n); return path; |
String | getPath(Node node) get Path NamedNodeMap nodeMap = node.getAttributes(); Node pathNode = nodeMap.getNamedItem("path"); if (pathNode != null) { return pathNode.getNodeValue(); } else return null; |
String | getValueViaPath(Node node, String path) Get the value of a node specified by a starting node and a path string. if (node instanceof Document) node = ((Document) node).getDocumentElement(); if (!(node instanceof Element)) return ""; path = path.trim(); int kAtsign = path.indexOf("@"); if (kAtsign == -1) { Element target = getElementViaPath(node, path); ... |
String | getValueViaPath(Node node, String path) Get the value of a node specified by a starting node and a path string. if (node instanceof Document) node = ((Document) node).getDocumentElement(); if (!(node instanceof Element)) return ""; path = path.trim(); int kAtsign = path.indexOf("@"); if (kAtsign == -1) { Element target = getElementViaPath(node, path); ... |
Vector | getVectorPathFromNode(Node node) get Vector Path From Node Vector path = new Vector(); while (node != null) { path.insertElementAt(node, 0); node = node.getParentNode(); return path; |
Vector | getVectorPathFromNode(Node node) get Vector Path From Node Vector path = new Vector(); while (node != null) { path.insertElementAt(node, 0); node = node.getParentNode(); return path; |