You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bbuzzard <Bi...@bnsflogistics.com> on 2016/06/08 13:37:41 UTC
XPath Content Based Routine Fails when urn xmlns is specified in
base element.
I am using JDK1.7 with apache-activemq-5.13.2 which is using
canel-core-5.13.2.
I am trying to route documents based on the value of an XML element. My
test route should routes documents to the "when" folder when the author's
name is "Bob" and it routes documents to the "otherwise" folder when the
author's name does not match "Bob". The route worked great until I started
added an xmlns containing a urn to the base element. As soon as I added the
urn all documents when to the "otherwise" folder. Adding a xmlns containing
a URL works. The documents that I expect to process will contain the URN.
What must I do to get this CBR working?
test1.xml will correctly route because it does NOT contain an URN in the
base element. test2.xml will NOT route correctly because it does contain an
URN in the base element. The "camel.xml" file contains my simple CBR".
camel.xml <http://camel.465427.n5.nabble.com/file/n5783701/camel.xml>
test1.xml <http://camel.465427.n5.nabble.com/file/n5783701/test1.xml>
test2.xml <http://camel.465427.n5.nabble.com/file/n5783701/test2.xml>
--
View this message in context: http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: XPath Content Based Routine Fails when urn xmlns is specified
in base element.
Posted by bbuzzard <Bi...@bnsflogistics.com>.
Thanks to souciance's reply I was able to figure out what I was doing wrong.
test2.xml defined the default namespace to an URN. In my CBR I had
specified an xpath that had no namespace at all. When I added the URN
namespace to my camelContext and then prefixed the XPath element with the
namespace prefix, everything worked.
--
View this message in context: http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701p5783730.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: XPath Content Based Routine Fails when urn xmlns is specified
in base element.
Posted by bbuzzard <Bi...@bnsflogistics.com>.
Thank you for your response, but I think you missed the point. The
http://camel.apache.org/xpath.html talks about namespaces that use URLs not
URNs. My problem seems to be specifically with namespaces that use URNs. I
need to know if there is a way for the CBR to ignore the default URN
namespace and if so how? If the default URN namespace cannot be ignored
then how so I register the URN namespace using Camel-Spring?
--
View this message in context: http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701p5783727.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: XPath Content Based Routine Fails when urn xmlns is specified
in base element.
Posted by souciance <so...@gmail.com>.
Take a lot at the namespace section in the documentation:
http://camel.apache.org/xpath.html
There is an example there for adding namespace support but it seems to be
for the java dsl. For the xml dsl you may need to add the namespace
manually in the xml declaration. Perhaps someone also knows if you
construct namespaces using the xml dsl?
On Wed, Jun 8, 2016 at 3:37 PM, bbuzzard [via Camel] <
ml-node+s465427n5783701h94@n5.nabble.com> wrote:
> I am using JDK1.7 with apache-activemq-5.13.2 which is using
> canel-core-5.13.2.
>
> I am trying to route documents based on the value of an XML element. My
> test route should routes documents to the "when" folder when the author's
> name is "Bob" and it routes documents to the "otherwise" folder when the
> author's name does not match "Bob". The route worked great until I started
> added an xmlns containing a urn to the base element. As soon as I added
> the urn all documents when to the "otherwise" folder. Adding a xmlns
> containing a URL works. The documents that I expect to process will
> contain the URN. What must I do to get this CBR working?
>
> test1.xml will correctly route because it does NOT contain an URN in the
> base element. test2.xml will NOT route correctly because it does contain
> an URN in the base element. The "camel.xml" file contains my simple CBR".
>
> camel.xml <http://camel.465427.n5.nabble.com/file/n5783701/camel.xml>
> test1.xml <http://camel.465427.n5.nabble.com/file/n5783701/test1.xml>
> test2.xml <http://camel.465427.n5.nabble.com/file/n5783701/test2.xml>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429h62@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701p5783715.html
Sent from the Camel - Users mailing list archive at Nabble.com.