camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: Xquery Transform using camel
Date Sun, 29 Mar 2015 08:48:49 GMT
Please use the user mailing list / user forum for such kind of questions.

Best,
Christian
Am 25.03.2015 06:34 schrieb "smilin" <smilin.s@gmail.com>:

> When i try to do
> from("direct:start")
>
> .transform(xquery("<Name>{/bookstore/book[1]/author/text()}</Name>"));,
> it give the expected result <Name>Giada De Laurentiis</Name>
>
> But when i try with  loop condition as below
>
> from("direct:start")
>         .transform(xquery("<BookList>{for $x at $i in /bookstore/book
> return
> <book>{bookstore/book[{$i}]/title/text()}</book>}</BookList>"));
>
> I throw error on line 1 column 73
>   XPST0003 XQuery syntax error near #...turn <book>'{bookstore/book[{$#:
>     Unexpected token "{" in path expression
> org.apache.camel.CamelExecutionException: Exception occurred during
> execution on the exchange: Exchange[Message: <?xml version="1.0"
> encoding="UTF-8"?>
>
> If i remove braces print reponse as
>
> "<BookList><book>bookstore/book[1]/title/text()</book><book>bookstore/book[2]/title/text()</book><book>bookstore/book[3]/title/text()</book><book>bookstore/book[4]/title/text()</book></BookList>"
>
> Is there a way i can execute this for condition "{for $x at $i in
> /bookstore/book return <book>{bookstore/book[{$i}]/title/text()}</book>}"
> through camel xquery API
>
> Thank you!
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Xquery-Transform-using-camel-tp5764730.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message