THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Some users may have XML stored in a header. To apply an XPath to a header's value you can do this by defining the 'headerName' attribute.
In Blueprint XML DSL:
Wiki Markup | ||
---|---|---|
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/XPathHeaderNameTest.xml} | ||
Code Block | ||
| ||
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:foo="http://example.com/person"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<camelContext id="xpathHeaderNameTest" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="direct:in"/>
<choice>
<when>
<xpath headerName="invoiceDetails">/invoice/@orderType = 'premium'</xpath>
<to uri="mock:premium"/>
</when>
<when>
<xpath headerName="invoiceDetails">/invoice/@orderType = 'standard'</xpath>
<to uri="mock:standard"/>
</when>
<otherwise>
<to uri="mock:unknown"/>
</otherwise>
</choice>
</route>
</camelContext>
</blueprint>
|
Examples
Here is a simple example using an XPath expression as a predicate in a Message Filter
...