Author |
Message
|
seeram52 |
Posted: Mon Mar 02, 2015 1:56 am Post subject: to find macima and minima in a given xml file. |
|
|
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 |
|
 |
vicentius |
Posted: Mon Mar 02, 2015 3:01 am Post subject: |
|
|
 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 |
|
 |
seeram52 |
Posted: Mon Mar 02, 2015 3:19 am Post subject: reply |
|
|
Newbie
Joined: 20 Feb 2015 Posts: 8
|
yes.. output should be which field consisting maximum and minimum.. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 02, 2015 6:19 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Mon Mar 02, 2015 6:20 am Post subject: Re: reply |
|
|
 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 |
|
 |
maurito |
Posted: Mon Mar 02, 2015 6:59 am Post subject: |
|
|
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 |
|
 |
Rix |
Posted: Mon Mar 16, 2015 1:16 pm Post subject: |
|
|
Newbie
Joined: 01 Apr 2014 Posts: 3
|
What about XPath in a map?
Something like:
|
|
Back to top |
|
 |
|