org.jboss.soa.esb.util
Class XPathUtil

java.lang.Object
  extended by org.jboss.soa.esb.util.XPathUtil

public class XPathUtil
extends java.lang.Object

Util methods for XPath related operations.

Since:
4.2
Author:
Daniel Bevenius

Constructor Summary
XPathUtil()
           
 
Method Summary
static org.w3c.dom.Document getDocument(java.lang.String xml)
          Parses the passed in xml and creates a Dom Document
static org.w3c.dom.Element getNodeFromXPathExpression(org.w3c.dom.Document document, java.lang.String xPathExpression)
          Will compile the passed in XPath expression and evalutate it against the passed in doument.
static org.w3c.dom.Element getNodeFromXPathExpression(java.lang.String xml, java.lang.String xPathExpression)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathUtil

public XPathUtil()
Method Detail

getDocument

public static org.w3c.dom.Document getDocument(java.lang.String xml)
                                        throws org.xml.sax.SAXException,
                                               java.io.IOException,
                                               javax.xml.parsers.ParserConfigurationException
Parses the passed in xml and creates a Dom Document

Parameters:
xml -
Returns:
Document
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

getNodeFromXPathExpression

public static org.w3c.dom.Element getNodeFromXPathExpression(org.w3c.dom.Document document,
                                                             java.lang.String xPathExpression)
                                                      throws javax.xml.xpath.XPathExpressionException
Will compile the passed in XPath expression and evalutate it against the passed in doument.

Parameters:
document - Document that the XPath expression should evaluate upon.
xPathExpression - XPath expression
Returns:
Element The Element found
Throws:
javax.xml.xpath.XPathExpressionException

getNodeFromXPathExpression

public static org.w3c.dom.Element getNodeFromXPathExpression(java.lang.String xml,
                                                             java.lang.String xPathExpression)
                                                      throws javax.xml.xpath.XPathExpressionException,
                                                             org.xml.sax.SAXException,
                                                             java.io.IOException,
                                                             javax.xml.parsers.ParserConfigurationException
Parameters:
xml - XML string that will be the target of the XPath evaluation
xPathExpression - XPath expression
Returns:
Element The Element found
Throws:
javax.xml.xpath.XPathExpressionException
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException