|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL Json parsing |
« View previous topic :: View next topic » |
Author |
Message
|
dileep1985 |
Posted: Fri Dec 01, 2017 6:26 am Post subject: ESQL Json parsing |
|
|
Novice
Joined: 15 Jul 2017 Posts: 15
|
Hi I have a requirement in which a json array will be passed in an XML . I need to get the value of a field from json array.
<TEST>
<Attributes>
<Attribute itemid ="test">item1</Attribute>
<Attribute itemid ="test1">item2</Attribute>
<Attribute itemid ="test3">{"bookingCode":null,"delivery":{"from":1512115200000,"to":1512496800000},"fullName":"TEST","countryName":"Great Britain",}</Attribute>
</Attributes>
</TEST>
I need to get the value of countryName and value of from from delivery. Could you please let me know any sample snippet |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 01, 2017 6:31 am Post subject: Re: ESQL Json parsing |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dileep1985 wrote: |
I need to get the value of countryName and value of from from delivery. |
So when you parsed the XML element that contains the JSON as JSON, what happened? What went wrong?
It should be that easy. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
souciance |
Posted: Fri Dec 01, 2017 5:09 pm Post subject: |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
Well, parse the xml field containing the json data, and create new output with the json data. Then extract whatever data you want from the json object. |
|
Back to top |
|
 |
martinb |
Posted: Sun Dec 03, 2017 12:53 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
For example code snippet see the info center topic here, look at example 7 and adapt to parse the content of your XML field containing the JSON. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|