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 » to find macima and minima in a given xml file.

Post new topic  Reply to topic
 to find macima and minima in a given xml file. « View previous topic :: View next topic » 
Author Message
seeram52
PostPosted: Mon Mar 02, 2015 1:56 am    Post subject: to find macima and minima in a given xml file. Reply with quote

Newbie

Joined: 20 Feb 2015
Posts: 8

hi, i am new trainee to IIB, i am trying to find Maxima and Minima from a XML file. i want to try using fieldtype function, can anyone give idea how to do and approach.


given input message is like this
<body>
<A>56</A>
<B>101</B>
<C>900</C>
<D>
<E>901</E>
<F>456</F>
<G>10000</G>
<H>678</H>
<I>89999</I>
<J>999</J>
</D>
<K>99</K>
<L>8</L>
</body>
[/b]
Back to top
View user's profile Send private message
vicentius
PostPosted: Mon Mar 02, 2015 3:01 am    Post subject: Reply with quote

Apprentice

Joined: 01 Mar 2013
Posts: 28

Given the input message body you posted, you need to loop through each child element of the root of the XML, irrespective to the field type, and compare its field value with the values already encountered, checking if your current value is lesser or greater than the current MINIM and MAXIM variables.
Is this your requirement?
Back to top
View user's profile Send private message
seeram52
PostPosted: Mon Mar 02, 2015 3:19 am    Post subject: reply Reply with quote

Newbie

Joined: 20 Feb 2015
Posts: 8

yes.. output should be which field consisting maximum and minimum..
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 02, 2015 6:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Moved to more relevant section
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 02, 2015 6:20 am    Post subject: Re: reply Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

seeram52 wrote:
yes.. output should be which field consisting maximum and minimum..


Then you need to loop through the elements as indicated, or use a SELECT to locate the values.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
maurito
PostPosted: Mon Mar 02, 2015 6:59 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

look at SELECT MAX and SELECT MIN in the infocentre, much more efficient than looping through the elements
Back to top
View user's profile Send private message
Rix
PostPosted: Mon Mar 16, 2015 1:16 pm    Post subject: Reply with quote

Newbie

Joined: 01 Apr 2014
Posts: 3

What about XPath in a map?
Something like:

Code:
max(//*[not(*)])

Code:
min(//*[not(*)])
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 » to find macima and minima in a given xml file.
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.