Package com.norconex.commons.lang.xml
Class XpathUtil
java.lang.Object
com.norconex.commons.lang.xml.XpathUtil
XPath-related utility methods.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringCreate an XPath attribute reference or an empty string if the attribute name is blank.static XPathnewXPath()Gets a new XPath instance from the default object model.static XPathExpressionnewXPathExpression(String expression) Gets a new compiledXPathExpressionfrom the given string.
-
Method Details
-
attr
Create an XPath attribute reference or an empty string if the attribute name is blank.- Parameters:
attributeName- the attribute name- Returns:
- the attribute name, prefixed with @, or an empty string (never null)
-
newXPath
Gets a new XPath instance from the default object model.- Returns:
- new XPath instance
-
newXPathExpression
Gets a new compiledXPathExpressionfrom the given string.- Parameters:
expression- the XPath string- Returns:
- compiled XPath expression
-