70.3. 示例
from("queue:foo") .filter().xquery("//foo") .to("queue:bar")
from("direct:start") .recipientList().xquery("concat('mock:foo.', /person/@city)", String.class);
<route> <from uri="direct:start"/> <recipientList> <xquery type="java.lang.String">concat('mock:foo.', /person/@city</xquery> </recipientList> </route>
70.3.1.
Namespaces ns = new Namespaces("c", "http://acme.com/cheese"); from("direct:start") .filter().xquery("/c:person[@name='James']", ns) .to("mock:result");
/c:person[@name='James']
Namespaces ns = new Namespaces("c", "http://acme.com/cheese") .add("w", "http://acme.com/wine") .add("b", "http://acme.com/beer");
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:foo="http://example.com/person" 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"> <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="activemq:MyQueue"/> <filter> <xquery>/foo:person[@name='James']</xquery> <to uri="mqseries:SomeOtherQueue"/> </filter> </route> </camelContext> </beans>