Package org.apache.camel.builder.xml

Examples of org.apache.camel.builder.xml.Namespaces


import org.apache.camel.builder.xml.Namespaces;

class SplitXmlNamespacesRouteBuilder extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        Namespaces namespaces = new Namespaces("c", "http://camelcookbook.org/schema/books")
            .add("se", "http://camelcookbook.org/schema/somethingElse");

        from("direct:in")
            .split(namespaces.xpath("/c:books/c:book[@category='Tech']/c:authors/c:author/text()"))
                .to("mock:out")
            .end();
    }
View Full Code Here


        }
    }

    protected void injectNamespaces(Element element, Binder<Node> binder) {
        NodeList list = element.getChildNodes();
        Namespaces namespaces = null;
        int size = list.getLength();
        for (int i = 0; i < size; i++) {
            Node child = list.item(i);
            if (child instanceof Element) {
                Element childElement = (Element) child;
                Object object = binder.getJAXBNode(child);
                if (object instanceof NamespaceAware) {
                    NamespaceAware namespaceAware = (NamespaceAware) object;
                    if (namespaces == null) {
                        namespaces = new Namespaces(element);
                    }
                    namespaces.configure(namespaceAware);
                }
                injectNamespaces(childElement, binder);
            }
        }
    }
View Full Code Here

        return ctx;
    }

    protected void injectNamespaces(Element element, Binder<Node> binder) {
        NodeList list = element.getChildNodes();
        Namespaces namespaces = null;
        int size = list.getLength();
        for (int i = 0; i < size; i++) {
            Node child = list.item(i);
            if (child instanceof Element) {
                Element childElement = (Element) child;
                Object object = binder.getJAXBNode(child);
                if (object instanceof NamespaceAware) {
                    NamespaceAware namespaceAware = (NamespaceAware) object;
                    if (namespaces == null) {
                        namespaces = new Namespaces(element);
                    }
                    namespaces.configure(namespaceAware);
                }
                injectNamespaces(childElement, binder);
            }
        }
    }
View Full Code Here

        }
    }

    protected void injectNamespaces(Element element, Binder<Node> binder) {
        NodeList list = element.getChildNodes();
        Namespaces namespaces = null;
        int size = list.getLength();
        for (int i = 0; i < size; i++) {
            Node child = list.item(i);
            if (child instanceof Element) {
                Element childElement = (Element)child;
                Object object = binder.getJAXBNode(child);
                if (object instanceof NamespaceAware) {
                    NamespaceAware namespaceAware = (NamespaceAware)object;
                    if (namespaces == null) {
                        namespaces = new Namespaces(element);
                    }
                    namespaces.configure(namespaceAware);
                }
                injectNamespaces(childElement, binder);
            }
        }
    }
View Full Code Here

   
    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").splitter().xpath("//one:other", namespaces).to("mock:result");               
            }
        };
    }
View Full Code Here

   
    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").splitter().xpath("//one:other", namespaces).to("mock:result");
            }
        };
    }
View Full Code Here

        }
    }

    protected void injectNamespaces(Element element) {
        NodeList list = element.getChildNodes();
        Namespaces namespaces = null;
        int size = list.getLength();
        for (int i = 0; i < size; i++) {
            Node child = list.item(i);
            if (child instanceof Element) {
                Element childElement = (Element)child;
                Object object = binder.getJAXBNode(child);
                if (object instanceof NamespaceAware) {
                    NamespaceAware namespaceAware = (NamespaceAware)object;
                    if (namespaces == null) {
                        namespaces = new Namespaces(element);
                    }
                    namespaces.configure(namespaceAware);
                }
                injectNamespaces(childElement);
            }
        }
    }
View Full Code Here

   
    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");
            }
        };
    }
View Full Code Here

        return ctx;
    }

    protected void injectNamespaces(Element element, Binder<Node> binder) {
        NodeList list = element.getChildNodes();
        Namespaces namespaces = null;
        int size = list.getLength();
        for (int i = 0; i < size; i++) {
            Node child = list.item(i);
            if (child instanceof Element) {
                Element childElement = (Element) child;
                Object object = binder.getJAXBNode(child);
                if (object instanceof NamespaceAware) {
                    NamespaceAware namespaceAware = (NamespaceAware) object;
                    if (namespaces == null) {
                        namespaces = new Namespaces(element);
                    }
                    namespaces.configure(namespaceAware);
                }
                injectNamespaces(childElement, binder);
            }
        }
    }
View Full Code Here

  public void process(Exchange exchange) throws Exception {

    String notifyUrl = XPathBuilder.xpath("//To", String.class).evaluate(exchange, String.class);
   
    if(notifyUrl.isEmpty()) {
      Namespaces ns = new Namespaces("wsa", "http://www.w3.org/2005/08/addressing");
      notifyUrl = ns.xpath("//wsa:To", String.class).evaluate(exchange, String.class);
    }

    injectUriAndQueryString(notifyUrl, exchange);
  }
View Full Code Here

TOP

Related Classes of org.apache.camel.builder.xml.Namespaces

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.