Package com.sun.identity.shared.xml
Class XPathAPI
- java.lang.Object
-
- com.sun.identity.shared.xml.XPathAPI
-
public class XPathAPI extends Object
XPathAPIclass provides the convenience function for XPath API that is a subset of Xalan XPathAPI but uses JAXP internally.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NodeListselectNodeList(Node doc, String str)Use an XPath string to select a nodelist.static NodeListselectNodeList(Node doc, String str, NamespaceContext nsctx)Use an XPath string to select a nodelist Namespace prefix is resolved using the the specified context.static NodeListselectNodeList(Node doc, String str, Node nsNode)Use an XPath string to select a nodelist using a node namespace.static NodeselectSingleNode(Node doc, String str)Use an XPath string to select a single node.static NodeselectSingleNode(Node doc, String str, NamespaceContext nsctx)Use an XPath string to select a single node using a passed in namespace context.static NodeselectSingleNode(Node doc, String str, Node nsNode)Use an XPath string to select a single node using a provided element namespace.
-
-
-
Method Detail
-
selectSingleNode
public static Node selectSingleNode(Node doc, String str) throws XPathException
Use an XPath string to select a single node. Namespace prefix is resolved using the document node.- Parameters:
doc- The node to start searching from with the embedded context.str- XPath string.- Returns:
- The first node found that matches the XPath, or null.
- Throws:
XPathException
-
selectSingleNode
public static Node selectSingleNode(Node doc, String str, Node nsNode) throws XPathException
Use an XPath string to select a single node using a provided element namespace.- Parameters:
doc- The node to start searching from.str- XPath string.nsNode- Node where namespace prefix in XPath is resolved from.- Returns:
- The first node found that matches the XPath, or null.
- Throws:
XPathException
-
selectSingleNode
public static Node selectSingleNode(Node doc, String str, NamespaceContext nsctx) throws XPathException
Use an XPath string to select a single node using a passed in namespace context.- Parameters:
doc- The node to start searching from.str- XPath string.nsctx- Namespace where the prefix in XPath is resolved from.- Returns:
- The first node found that matches the XPath, or null.
- Throws:
XPathException
-
selectNodeList
public static NodeList selectNodeList(Node doc, String str) throws XPathException
Use an XPath string to select a nodelist. Namespace prefix is resolved using the document node.- Parameters:
doc- The node to start searching from.str- XPath string.- Returns:
- a NodeList of the matched result.
- Throws:
XPathException
-
selectNodeList
public static NodeList selectNodeList(Node doc, String str, Node nsNode) throws XPathException
Use an XPath string to select a nodelist using a node namespace.- Parameters:
doc- The node to start searching from.str- XPath string.nsNode- Node where namespace prefix in XPath is resolved from.- Returns:
- a NodeList of the matched result.
- Throws:
XPathException
-
selectNodeList
public static NodeList selectNodeList(Node doc, String str, NamespaceContext nsctx) throws XPathException
Use an XPath string to select a nodelist Namespace prefix is resolved using the the specified context.- Parameters:
doc- The node to start searching from.str- XPath string.nsctx- Namespace where the prefix in XPath is resolved from.- Returns:
- a NodeList.
- Throws:
XPathException
-
-