}
}
public BaseXPath createXPath(String xpath, Collection<OMNamespace> omNameSpaces) {
if (xpath == null || "".equals(xpath)) {
throw new LoggedRuntimeException("XPath expression is null or empty", log);
}
try {
SynapseXPath synapseXPath = new SynapseXPath(xpath);
for (OMNamespace omNamespace : omNameSpaces) {
if (omNamespace != null) {
synapseXPath.addNamespace(omNamespace.getPrefix(), omNamespace.getNamespaceURI());
}
}
return synapseXPath;
} catch (JaxenException e) {
throw new LoggedRuntimeException("Invalid XPapth expression : " +
xpath, e, log);
}
}