Hi,

I am using Apache Synapse 2.0-SNAPSHOT and I have a problem with XPATH
expressions.

I have defined the following configuration:

..
<configuration:switch
source="{http://mytravelagency.com}searchFlights/{http://mytravelagency.com}destination";>
..

which should be a a valid XPATH expression.

Synapse throws the following exception:

ERROR SynapseServer - Error starting Apache Synapse, trying a clean shutdown...
org.apache.synapse.SynapseException: Invalid XPath for attribute
'source' : 
{http://mytravelagency.com}searchFlights/{http://mytravelagency.com}destination
       at 
org.apache.synapse.config.xml.SwitchMediatorFactory.createSpecificMediator(SwitchMediatorFactory.java:71)
       at 
org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:88)
       ......

I've also looked at the code and saw that the SwitchMediatorFactory
directly calls new SynapseXPath(xpathAttrib.getAttributeValue()),
whereas in your test cases you are rather using the
SynapseXPath.parseXPathString(XPATHString) method which does some
preprocessing especially with namespaces. Wouldn't it be better to use
that method in the Switch MediatorFactory instead ?

Thanks,

Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to