Hi,

i am trying to group xml's with same id and count the number of items in
each group. I am using camel 2.8.0

For Eg:
Input xml:
<order>
   <item>
       <id>1</id>
       <description>test item 1</description>
    </item>
    <item>
       <id>2</id>
       <description>test item 1</description>
    </item>
    <item>
       <id>1</id>
       <description>test item 1</description>
    </item>
    <item>
       <id>3</id>
       <description>test item 1</description>
    </item>
</order>

I am trying to achieve it in the following manner:
<from uri="file://[source folder]" />
<split>
              <xpath>/order/item</xpath>
              <setHeader headerName="asnid">
                    <xpath>/item/id/text()</xpath>
               </setHeader>
                <setHeader headerName="itemCount">
                        <xpath
resultType="java.lang.String">count(/item)</xpath>
                 </setHeader>
</split>
 The above approach is not working. Can I use aggregator, if so how?

Thanks,
Deepthi



--
View this message in context: 
http://camel.465427.n5.nabble.com/Grouping-of-xml-and-count-of-each-tp5717086.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to