ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportESQL Json parsing

Post new topicReply to topic
ESQL Json parsing View previous topic :: View next topic
Author Message
dileep1985
PostPosted: Fri Dec 01, 2017 6:26 am Post subject: ESQL Json parsing Reply with quote

Novice

Joined: 15 Jul 2017
Posts: 11

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
View user's profile Send private message
Vitor
PostPosted: Fri Dec 01, 2017 6:31 am Post subject: Re: ESQL Json parsing Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24648
Location: Ohio, 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
View user's profile Send private message
souciance
PostPosted: Fri Dec 01, 2017 5:09 pm Post subject: Reply with quote

Voyager

Joined: 29 Jun 2010
Posts: 83

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
View user's profile Send private message
martinb
PostPosted: Sun Dec 03, 2017 12:53 am Post subject: Reply with quote

Disciple

Joined: 09 Nov 2006
Posts: 179
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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportESQL Json parsing
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.