Home » synapse-1.2-src » org.apache.synapse.util.xpath » [javadoc | source]
org.apache.synapse.util.xpath
public class: SynapseXPath [javadoc | source]
java.lang.Object
   org.apache.axiom.om.xpath.AXIOMXPath
      org.apache.synapse.util.xpath.SynapseXPath

XPath that has been used inside Synapse xpath processing. This has a extension function named get-property which is use to retrieve message context properties with the given name from the function

For example the following function get-property('prop') can be evaluatedd using an XPath to retrieve the message context property value with the name prop.

Apart from that this XPath has a certain set of XPath variables associated with it. They are as follows;

body
The SOAP 1.1 or 1.2 body element.
header
The SOAP 1.1 or 1.2 header element.

Also there are some XPath prefixes defined in SynapseXPath to access various properties using XPath variables, where the variable name represents the particular prefix and the property name as the local part of the variable. Those variables are;

ctx
Prefix for Synapse MessageContext properties
axis2
Prefix for Axis2 MessageContext properties
trp
Prefix for the transport headers

This XPath is Thread Safe, and provides a special set of evaluate functions for the MessageContext and SOAPEnvelope as well as a method to retrieve string values of the evaluated XPaths

Constructor:
 public SynapseXPath(String xpathString) throws JaxenException 

    Initializes the SynapseXPath with the given xpathString as the XPath

    Parameters:
    xpathString - xpath in its string format
    Throws:
    JaxenException - in case of an initialization failure
Method from org.apache.synapse.util.xpath.SynapseXPath Summary:
addNamespace,   getContext,   stringValueOf
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.synapse.util.xpath.SynapseXPath Detail:
 public  void addNamespace(OMNamespace ns) throws JaxenException 
 protected Context getContext(Object obj) 
 public String stringValueOf(MessageContext synCtx) 

    Evaluates the XPath expression against the MessageContext of the current message and returns a String representation of the result