Subject:Continous sequence check Author:Santhosh Thottingal Date:22 Feb 2007 07:08 AM
Hi gurus,
Please help me in solving the following problem
I have one xml file in the format
<list>
<rate name="prod1" from="001" to="008" />
<rate name="prod2" from="012" to="019" />
<rate name="prod3" value="019" />
<list>
And another XML with the format
<products>
<product>
<name>prod1</name>
value>002</value>
<product>
<product>
<name>prod1</name>
<value>003</value>
<product>
<product>
<name>prod1</name>
<value>004</value>
<product>
<product>
<name>prod1</name>
<value>006</value>
<product>
<product>
<name>prod1</name>
<value>007</value>
<product>
<product>
<name>prod2</name>
<value>012</value>
<product>
<product>
<name>prod2</name>
<value>013</value>
<product>
</products>
By joining these XMLs I want the following output
<list>
<rate name="prod1" from="002" to="004" />
<rate name="prod1" from="006" to="007" />
<rate name="prod2" from="012" to="013" />
<list>
i.e. I want to get the continues sequences of 'value' (002-004 006-007 like that)in the second xml and I want to put it in the first xml as the corrected ranges.
Please help me to solve this..
Thanks in advance
-santhosh