Hi, to fix it you can replace the following line in SynapseXPathFactory.getSynapseXPath(elem, ATT_SOURCE):
LINE 47: xpath = new SynapseXPath(xpathAttrib.getAttributeValue()); by xpath = SynapseXPath.parseXPathString(xpathAttrib.getAttributeValue()); Thanks, Benjamin On Wed, Dec 15, 2010 at 3:16 PM, Ruwan Linton <[email protected]> wrote: > I think you are correct, let me have a look at using the parseXPathString > instead of the current one. > Thanks, > Ruwan > > On Wed, Dec 15, 2010 at 5:21 PM, Benjamin Schmeling > <[email protected]> wrote: >> >> 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] >> > > > > -- > Ruwan Linton > Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb > WSO2 Inc.; http://wso2.org > > Lean . Enterprise . Middleware > > phone: +1 408 754 7388 ext 51789 > email: [email protected]; cell: +94 77 341 3097 > blog: http://blog.ruwan.org > linkedin: http://www.linkedin.com/in/ruwanlinton > google: http://www.google.com/profiles/ruwan.linton > tweet: http://twitter.com/ruwanlinton > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
