You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@yahoo.com> on 2010/03/26 16:26:37 UTC

Wildcard Namespaces in XPath Injection

Hello,
I have been doing XPath injection and it is pretty cool.  Using the
instructions here, I created my own copy of the XPath annotation:

http://camel.apache.org/xpath.html

My question, how can I use wildcard namespaces?  If you do something like
this it fails due to the asterick:

@Path("//*:bar/text()") String bar

However, if you want to get verbose about it, you can get it to work:

@Path("//child::* [local-name(.)='bar']") String bar

Any idea whether the custom XPath injection will support the simpler '*'
syntax?

Cheers,
Yogesh
-- 
View this message in context: http://old.nabble.com/Wildcard-Namespaces-in-XPath-Injection-tp28044062p28044062.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Wildcard Namespaces in XPath Injection

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Mar 26, 2010 at 4:26 PM, ychawla <pr...@yahoo.com> wrote:
>
> Hello,
> I have been doing XPath injection and it is pretty cool.  Using the
> instructions here, I created my own copy of the XPath annotation:
>
> http://camel.apache.org/xpath.html
>
> My question, how can I use wildcard namespaces?  If you do something like
> this it fails due to the asterick:
>
> @Path("//*:bar/text()") String bar
>
> However, if you want to get verbose about it, you can get it to work:
>
> @Path("//child::* [local-name(.)='bar']") String bar
>
> Any idea whether the custom XPath injection will support the simpler '*'
> syntax?
>

You can try to use the standard API from JDK for the XPath wildcard
stuff to see if you can get it working.
Camel uses this API under the covers. So Camel depends on what this API can do.


> Cheers,
> Yogesh
> --
> View this message in context: http://old.nabble.com/Wildcard-Namespaces-in-XPath-Injection-tp28044062p28044062.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus