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 » Searching a field from Input XML

Post new topic  Reply to topic
 Searching a field from Input XML « View previous topic :: View next topic » 
Author Message
aggarwal.intouch
PostPosted: Mon Feb 10, 2014 4:20 am    Post subject: Searching a field from Input XML Reply with quote

Acolyte

Joined: 30 May 2011
Posts: 56
Location: India

Hi All,

I have a requirement that I have to search some element and get its respective value from XML. There are mentioned 2 below queries:-

1)I do not know the correct XPath of that element as that element can come anywhere and at any level in the Input XML.

2)The element can be of any name 'ValidateCode', 'ValidateType', 'ValidateCodeType', 'ValidateTypeCode'. Only thing which would be common would be 'Validate' keyword will always be there in that field.. I have to find this element in XML and take out its value. At a time one XML will have only 1 'Validate' tag from all 4 options stated above.

I tried below code but it is not working:-

SET Environment.Variable.a = THE(SELECT * FROM InputRoot.XMLNSC AS I where FIELDNAME(I.*) = BEGINSWITH ('Validate');
Back to top
View user's profile Send private message Send e-mail
dogorsy
PostPosted: Mon Feb 10, 2014 4:37 am    Post subject: Re: Searching a field from Input XML Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

aggarwal.intouch wrote:
Hi All,

I have a requirement that I have to search some element and get its respective value from XML. There are mentioned 2 below queries:-

1)I do not know the correct XPath of that element as that element can come anywhere and at any level in the Input XML.

2)The element can be of any name 'ValidateCode', 'ValidateType', 'ValidateCodeType', 'ValidateTypeCode'. Only thing which would be common would be 'Validate' keyword will always be there in that field.. I have to find this element in XML and take out its value. At a time one XML will have only 1 'Validate' tag from all 4 options stated above.

I tried below code but it is not working:-

SET Environment.Variable.a = THE(SELECT * FROM InputRoot.XMLNSC AS I where FIELDNAME(I.*) = BEGINSWITH ('Validate');

If the element can be anywhere in the message, then a select will not work.
Loop through the message until you locate the desired tag. You can use the navigate function ( in the infocentre, create procedure statement ) and modify it as required.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Searching a field from Input XML
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.