camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: @XPath evaluation
Date Fri, 24 Aug 2012 19:35:04 GMT
Yes, should be possible.

Sent from a mobile device
Am 24.08.2012 13:56 schrieb "Joe San" <codeintheopen@gmail.com>:

> The most common language to use is XPath, which allows you to evaluate
> XPath
> expressions on the message body. For example, suppose the message contains
> the following
> XML document:
>
> <order customerId="123">
>     <status>in progress</status>
> </order>
>
> By using XPath expressions, you can extract parts of the document and bind
> them to
> parameters, like this:
>
> public void updateStatus(@XPath("/order/@customerId") Integer customerId,
> @XPath("/order/status/text()") String status) {
>     ....
>     ....
> }
>
> The above snippet is from the Camel in Action book. Can I use the @XPath to
> evaluate to a List < Person >?
>
> My xml would look like this:
>
> <info>
>     <address>
>         <street>xyz</street>
>         <city>Frankfurt</city>
>     </address>
>
>     <person>
>         <name>joe</name>
>         <age>32</age>
>         <country>Germany</country>
>     </person>
>
>     <person>
>         <name>sam</name>
>         <age>32</age>
>         <country>Germany</country>
>     </person>
>
> </info>
>
> The XPath should evaluate the fetch the List of Person objects!
>
> Regards,
> Jothi
>

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