*
* @see org.apache.synapse.spi.Processor#compile(org.apache.synapse.api.SynapseEnvironment,
* org.apache.axis2.om.OMElement)
*/
public Processor createProcessor(SynapseEnvironment se, OMElement el) {
XPathProcessor xp = new XPathProcessor();
super.addChildrenAndSetName(se, el, xp);
OMAttribute expr = el.getAttribute(XPATH_EXPRESSION_ATT_Q);
if (expr == null) {
throw new SynapseException(XPATH + " must have "
+ XPATH_EXPRESSION_ATT_Q + " attribute: " + el.toString());
}
xp.setXPathExpr(expr.getAttributeValue());
Iterator it = el.getAllDeclaredNamespaces();
while (it.hasNext()) {
OMNamespace n = (OMNamespace) it.next();
xp.addXPathNamespace(n.getPrefix(), n.getName());
}
return xp;
}