Search in sources :

Example 11 with Namespaces

use of org.apache.camel.builder.xml.Namespaces in project camel by apache.

the class SetHeaderIssueTest method createRouteBuilder.

protected RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {

        public void configure() {
            // START SNIPPET: example
            Namespaces ns = new Namespaces("foo", "urn:cheese");
            from("direct:start").unmarshal().string().setHeader("foo", ns.xpath("/foo:person[@name='James']")).filter(ns.xpath("/foo:person[@name='James']")).to("mock:result");
        // END SNIPPET: example
        }
    };
}
Also used : Namespaces(org.apache.camel.builder.xml.Namespaces) RouteBuilder(org.apache.camel.builder.RouteBuilder)

Example 12 with Namespaces

use of org.apache.camel.builder.xml.Namespaces in project camel by apache.

the class SplitterWithXqureyTest method createRouteBuilder.

protected RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {

        public void configure() {
            // split the message with namespaces defined 
            Namespaces namespaces = new Namespaces("one", "http://camel.apache.org/schema/one");
            from("direct:endpoint").split().xpath("//one:other", namespaces).to("mock:result");
        }
    };
}
Also used : Namespaces(org.apache.camel.builder.xml.Namespaces) RouteBuilder(org.apache.camel.builder.RouteBuilder)

Aggregations

Namespaces (org.apache.camel.builder.xml.Namespaces)12 RouteBuilder (org.apache.camel.builder.RouteBuilder)10 Element (org.w3c.dom.Element)3 NamespaceAware (org.apache.camel.spi.NamespaceAware)2 Node (org.w3c.dom.Node)2 NodeList (org.w3c.dom.NodeList)2 Endpoint (org.apache.camel.Endpoint)1 Exchange (org.apache.camel.Exchange)1 Processor (org.apache.camel.Processor)1 ExpressionNode (org.apache.camel.model.ExpressionNode)1