Willem 

Attached are sample XMLs, config and java code which replicates the problem.  
Unfortunately I don't know how to read from a file (I'm very new to this) and 
so it still depends on JMS.

I am using Camel version 2.5-SNAPSHOT.

Thanks for your help


 
Steven Hedges


-----Original Message-----
From: Willem Jiang [mailto:[email protected]] 
Sent: 24 September 2010 02:26
To: [email protected]
Subject: Re: Problem with XPATH filtering

Hi

Which version of Camel are you using?
Can you submit a simple test case to reproduce this error into the JIRA?
So we can dig the issue more quickly.

On 9/24/10 12:15 AM, [email protected] wrote:
> Hi
>
> I am currently evaluating Camel for use on a project.  I am having a problem 
> with xpath filtering - which always returns false even if the xpath matches 
> the inbound document.
>
> So I have the following route definition:
>
> public void configure() throws Exception {
>
> from("jms:queue:TEST.QUEUE.SRH")
>       .process(new Logger())
>       .filter()
>               .xpath("//par...@id='compression' or @id='TriOptima']")
>                       .process(new Logger("after filter"))
>       .choice()
>               .when().xpath("//termination")
>                       .process(new Logger("TERMINATION"))
>                       .to("file:FOO")
>               .when().xpath("/STPTradeML/FpML/trade")
>                       .process(new Logger("NEW TRADE "))
>                       .to("file:BAR")
>               .otherwise()
>                       .process(new Logger("otherwise "))
>                       .to("file:LOGGER")
>       .to("file:c://output.log");
> }
>
> Then I send in a message which matches the first xpath (tested in XML Spy).  
> Tracking through the code shows that this results in an answer of false.
>
> Are there any current known issues with xpath filtering?  Do I need to use 
> namespaces, for example?
>
> Any help or pointers you can provide would be welcome
>
> Steve Hedges
>
> _______________________________________________
>
> This e-mail may contain information that is confidential, privileged 
> or otherwise protected from disclosure. If you are not an intended 
> recipient of this e-mail, do not duplicate or redistribute it by any 
> means. Please delete it and any attachments and notify the sender that 
> you have received it in error. Unless specifically indicated, this 
> e-mail is not an offer to buy or sell or a solicitation to buy or sell 
> any securities, investment products or other financial product or 
> service, an official confirmation of any transaction, or an official 
> statement of Barclays. Any views or opinions presented are solely 
> those of the author and do not necessarily represent those of 
> Barclays. This e-mail is subject to terms available at the following 
> link: www.barcap.com/emaildisclaimer. By messaging with Barclays you 
> consent to the foregoing.  Barclays Capital is the investment banking 
> division of Barclays Bank PLC, a company registered in England (number 
> 1026167) with its registered off
ice at 1 Churchill Place, London, E14 5HP.  This email may relate to or be sent 
from other members of the Barclays Group.
> _______________________________________________
>


--
Willem
----------------------------------
Apache Camel, Apache CXF committer
Open Source Integration: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: http://twitter.com/willemjiang
<STPTradeML xmlns="http://www.barcap.com/gcd/stpengine/1-0";>
	<FpML>
		<trade/>
</FpML>
</STPTradeML>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:camel="http://camel.apache.org/schema/spring";
	xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd";>

	<bean
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>classpath:dev.properties</value>
		</property>
	</bean>
	<camel:camelContext id="camel">
		<camel:template id="camelTemplate" />

	</camel:camelContext>




	<!-- temporary: set up a JMS queue in DEV -->
	<bean id="ConnectionFactory" class="com.tibco.tibjms.TibjmsConnectionFactory">
		<property name="serverUrl" value="${ems.server.url}" />
		<property name="userName" value="${ems.userName}" />
		<property name="userPassword" value="${ems.userPassword}" />
	</bean>

	<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="ConnectionFactory" />
	</bean>
	
	<bean id="jndiEnvironment" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
  		<property name="properties">
  			<props>		
				<prop key="java.naming.factory.initial">com.tibco.tibjms.naming.TibjmsInitialContextFactory</prop>
				<prop key="java.naming.provider.url">${ems.server.url}</prop>					
				<prop key="java.naming.security.principal">${ems.userName}</prop>
				<prop key="java.naming.security.credentials">${ems.userPassword}</prop>
			</props>
		</property>	
	</bean>
	
	<bean id="BrokerFeedListener" 
		class="org.springframework.jndi.JndiObjectFactoryBean">	
		<property name="jndiEnvironment" ref="jndiEnvironment"/>		
		<property name="jndiName" value="${ems.destination}"/>
	</bean>


</beans>

Reply via email to