Code example for Element

Methods: getParentNode

0
		if (findByAttrName != null && node.getNodeType() == Node.ELEMENT_NODE) {
			Element element = ((Element) node);
			// Optimisation : don't execute XPath if class come from for 
			// attribute name 
			if (findByParentNode) {
				Node parent = element.getParentNode();
				if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
					return ((Element) parent).getAttribute(findByAttrName);
				} 
				return null; 
			} 
			return element.getAttribute(findByAttrName);
		} 
 
		return XPathManager.getManager().evaluateString(xpathFactoryProviderId,
				node, pathForClass, namespaceInfo, null);
	} 
 
}