Java Utililty Methods XML Node Path

List of utility methods to do XML Node Path

Description

The list of methods to do XML Node Path are organized into topic(s).

Method

StringgetNodesPathName(Node node)
Returns the path expression for a given node.
final StringBuffer buffer = new StringBuffer();
buildNodeName(node, buffer);
return buffer.toString();
NodegetNXInfo(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;
...
NodegetNXInfo1(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)
...
NodegetNXInfoDefault(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;
...
StringgetPath(Node n)
get Path
String path = "";
while (n != null) {
    path = "/" + getPathElement(n) + path;
    n = getParent(n);
return path;
StringgetPath(Node node)
get Path
NamedNodeMap nodeMap = node.getAttributes();
Node pathNode = nodeMap.getNamedItem("path");
if (pathNode != null) {
    return pathNode.getNodeValue();
} else
    return null;
StringgetValueViaPath(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);
...
StringgetValueViaPath(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);
...
VectorgetVectorPathFromNode(Node node)
get Vector Path From Node
Vector path = new Vector();
while (node != null) {
    path.insertElementAt(node, 0);
    node = node.getParentNode();
return path;
VectorgetVectorPathFromNode(Node node)
get Vector Path From Node
Vector path = new Vector();
while (node != null) {
    path.insertElementAt(node, 0);
    node = node.getParentNode();
return path;