Reputation: 38
i am getting a response in this format. i want to split the message in to different messages
<ROOT>
<id/>
<date>
<fieldname/>
<fieldvalue/>
<fieldname/>
<fieldvalue/>
<fieldname/>
<fieldvalue/>
<id/>
<date>
<fieldname/>
<fieldvalue/>
<fieldname/>
<fieldvalue/>
<fieldname/>
<fieldvalue/>
</ROOT>
where fieldname and fieldvalue can be many
i want to split this starting from id to next id is a new record
Upvotes: 0
Views: 66
Reputation: 3266
I would recommend first mapping towards an own, custom schema.
Something like this:
<ROOT>
<Message>
<id>1</id>
<date>2017-09-18</date>
<fieldname>fieldvalue</fieldname>
<fieldname2>fieldvalue2</fieldname2>
<fieldname3>fieldvalue3</fieldname3>
</Message>
<Message>
<id>1</id>
<date>2017-09-18</date>
<fieldname>fieldvalue</fieldname>
<fieldname2>fieldvalue2</fieldname2>
<fieldname3>fieldvalue3</fieldname3>
</Message>
</ROOT>
Once you have this, you can use XML debatching to de-batch your messages based on the /Root
Body path.
Upvotes: 2