How map the SQL query values in to XML Payload?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How map the SQL query values in to XML Payload?

Sathiyaprabu
Hi,
I'm fetching records from a DB and want to set those values in XML payload. Whats the way in Spring XML DSL approach? Any idea.. Or Any other way or approach is there???
Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: How map the SQL query values in to XML Payload?

Łukasz Dywicki
You can use xstream data format to turn java object into XML data structure. It doesn't require any annotations to run.

Cheers,
Lukasz Dywicki
--
[hidden email]
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez sprabu w dniu 25 gru 2012, o godz. 21:38:

> Hi,
> I'm fetching records from a DB and want to set those values in XML payload.
> Whats the way in Spring XML DSL approach? Any idea.. Or Any other way or
> approach is there???
> Thanks in advance.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-map-the-SQL-query-values-in-to-XML-Payload-tp5724584.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: How map the SQL query values in to XML Payload?

Christian Mueller
Administrator
In reply to this post by Sathiyaprabu
Or use JAXB, the standard for Java XML binding...

Best,
Christian

Sent from a mobile device
Am 26.12.2012 02:21 schrieb "sprabu" <[hidden email]>:

> Hi,
> I'm fetching records from a DB and want to set those values in XML payload.
> Whats the way in Spring XML DSL approach? Any idea.. Or Any other way or
> approach is there???
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-map-the-SQL-query-values-in-to-XML-Payload-tp5724584.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: How map the SQL query values in to XML Payload?

Claus Ibsen-2
In reply to this post by Sathiyaprabu
Hi

You can also look at using a template engine to build up a XML
document as a template and use tokens where the DB values should be
inserted.

Such as velocity / freemarker
http://camel.apache.org/velocity

Or use XSLT (albeit can be hard to do correct)
http://camel.apache.org/xslt

On Tue, Dec 25, 2012 at 9:38 PM, sprabu <[hidden email]> wrote:

> Hi,
> I'm fetching records from a DB and want to set those values in XML payload.
> Whats the way in Spring XML DSL approach? Any idea.. Or Any other way or
> approach is there???
> Thanks in advance.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-map-the-SQL-query-values-in-to-XML-Payload-tp5724584.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: How map the SQL query values in to XML Payload?

Sathiyaprabu
Hi,
Already i'm doing message transformation  by using xslt. I don't know how i fetch the DB values and bring it to xsl transformation. Any way or idea...

Reply | Threaded
Open this post in threaded view
|

Re: How map the SQL query values in to XML Payload?

Sathiyaprabu
Is it possible to bring the DB values in to XSL ??? If so, can you please tell me how?

Many Thanks in Advance.
Reply | Threaded
Open this post in threaded view
|

Re: How map the SQL query values in to XML Payload?

Christian Mueller
Administrator
You receive the database content as list/map. Than you can use a bean or
processor to transfom it to everything you need. E. g. to a JAXB bean and
than marshall [1] it to xml.
You don't have to use xslt.

[1] http://camel.apache.org/jaxb.html

Best,
Christian

On Mon, Jan 7, 2013 at 11:43 AM, sprabu <[hidden email]> wrote:

> Is it possible to bring the DB values in to XSL ??? If so, can you please
> tell me how?
>
> Many Thanks in Advance.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-map-the-SQL-query-values-in-to-XML-Payload-tp5724584p5725044.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--