use of org.apache.camel.builder.xml.Namespaces in project camel by apache.
the class CamelNamespaceHandler method injectNamespaces.
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);
}
}
}
use of org.apache.camel.builder.xml.Namespaces in project camel by apache.
the class XQueryHeaderNameResultTypeAndNamespaceTest method createRouteBuilder.
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
Namespaces ns = new Namespaces("c", "http://acme.com/cheese");
from("direct:in").choice().when().xquery("/c:number = 55", Integer.class, ns, "cheeseDetails").to("mock:55").otherwise().to("mock:other").end();
}
};
}
use of org.apache.camel.builder.xml.Namespaces in project camel by apache.
the class XQueryWithNamespacesFilterTest method createRouteBuilder.
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
// START SNIPPET: example
Namespaces ns = new Namespaces("c", "http://acme.com/cheese");
from("direct:start").filter().xquery("/c:person[@name='James']", ns).to("mock:result");
// END SNIPPET: example
}
};
}
use of org.apache.camel.builder.xml.Namespaces in project camel by apache.
the class RssToHttpIssueTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
Namespaces ns = new Namespaces("atom", "http://www.w3.org/2005/Atom");
from("rss:http://www.plosone.org/article/feed").marshal().rss().setHeader(Exchange.HTTP_URI).xpath("//atom:entry/atom:link[@type=\"application/pdf\"]/@href", ns).to("http://dummy").to("mock:end");
}
};
}
use of org.apache.camel.builder.xml.Namespaces in project camel by apache.
the class CamelNamespaceHandler method injectNamespaces.
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);
}
}
}
Aggregations