Here you can find the source of addAttributeToXPathExpression(Node nodeAttr, String xpathExpression, String and)
Parameter | Description |
---|---|
nodeAttr | a parameter |
xpathExpression | a parameter |
and | a parameter |
private static String addAttributeToXPathExpression(Node nodeAttr, String xpathExpression, String and)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; public class Main { /**// www. j a v a 2 s . c o m * * @param nodeAttr * @param xpathExpression * @param and * @return */ private static String addAttributeToXPathExpression(Node nodeAttr, String xpathExpression, String and) { // si no esta vacio el atributo String value = nodeAttr.getNodeValue(); xpathExpression = xpathExpression + and + "@" + nodeAttr.getNodeName() + "='" + value + "'"; return xpathExpression; } private static String addAttributeToXPathExpression(String attribute, String value, String xpathExpression, String and) { // si no esta vacio el atributo xpathExpression = xpathExpression + and + "@" + attribute + "='" + value + "'"; return xpathExpression; } }