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 Index » WebSphere Message Broker (ACE) Support » Accessing xml elements

Post new topic  Reply to topic Goto page Previous  1, 2
 Accessing xml elements « View previous topic :: View next topic » 
Author Message
marquies
PostPosted: Wed May 11, 2016 12:04 am    Post subject: Reply with quote

Novice

Joined: 01 Feb 2012
Posts: 15

Hi All,

In this same example i.e.

<Message>
<A>
<B>
<AdditionalFlds>
<Field name="f1">abc</Field>
<Field name="f2">def</Field>
<AdditionalFlds>
</Message>

can I directly fetch the value of the element <field> using the attribute value 'name'..? i.e. fetch the values abc or def.

Example: InputRoot.XMLNSC.Message.A.B.AdditionalFlds.Field('f1')
Back to top
View user's profile Send private message
maurito
PostPosted: Wed May 11, 2016 1:06 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

marquies wrote:
Hi All,

In this same example i.e.

<Message>
<A>
<B>
<AdditionalFlds>
<Field name="f1">abc</Field>
<Field name="f2">def</Field>
<AdditionalFlds>
</Message>

can I directly fetch the value of the element <field> using the attribute value 'name'..? i.e. fetch the values abc or def.

Example: InputRoot.XMLNSC.Message.A.B.AdditionalFlds.Field('f1')

Why don't you try yourself ?... also, you can use the Knowledge Center in which it is explained how to access xml attributes, there are also some good examples.
Back to top
View user's profile Send private message
marquies
PostPosted: Wed May 11, 2016 1:25 am    Post subject: Reply with quote

Novice

Joined: 01 Feb 2012
Posts: 15

Thanks Maurito for the advice.

I tried it myself but couldn't succeed hence posted it on the forum.
Back to top
View user's profile Send private message
maurito
PostPosted: Wed May 11, 2016 1:26 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

marquies wrote:
Thanks Maurito for the advice.

I tried it myself but couldn't succeed hence posted it on the forum.

What about the Knowledge Center?
Back to top
View user's profile Send private message
timber
PostPosted: Wed May 11, 2016 2:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

In XPath you can add a predicate to the path expression to select the node that you want. It's possible that marquies has used that, and wants to know how to do the same thing using ESQL. It can be done, and the answer is here:
http://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak05620_.htm?lang=en
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Accessing xml elements
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.