Hi,
I have few xml files (depends on user how much he/she wants to pass). I
have to take those files and merge them, so I have created a loop and in
that I am passing these files one by one. For this I have written few rules
to merge. But there is this <Procedure> tag where I am stuck. To merge this
I need to parse each Procedure and have to modify its attributes (attrProc
and attrLevel). I have to replace the attrProc attribute with a sequential
value and for me this will set a unique "Level" for each Procedure tag and
later I will process them based on their level.
*File1.xml*
*<?xml version="1.0" encoding="UTF-8"?>*
*<InfoTag>*
*<Procedure attrProc="TestProcA" attrLevel="1">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure>*
* <Procedure attrProc="TestProcB" attrLevel="2">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure>*
*</InfoTag>*
*File2.xml*
*<?xml version="1.0" encoding="UTF-8"?>*
*<InfoTag>*
*<Procedure attrProc="TestProcC" attrLevel="3">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure>*
* <Procedure attrProc="TestProcD" attrLevel="4">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure>*
*</InfoTag>*
I am trying to fetch an output file which looks like this:
*Output.xml*
*<InfoTag>*
*<Procedure attrProc="1" attrLevel="### NOT UNIQUE ###">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure>*
* <Procedure attrProc="2" attrLevel="### NOT UNIQUE ###">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure>*
*<Procedure attrProc="3" attrLevel="### NOT UNIQUE ###">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure>*
* <Procedure attrProc="4" attrLevel="### NOT UNIQUE ###">*
* <downTime>*
* <acceptableDownTime>*
* <all/>*
* </acceptableDownTime>*
* <downTimePeriod time="600000000"/>*
* </downTime>*
* </Procedure> *
*</InfoTag>*
I am thinking of looping it and will count the occurrences of it and then I
am thinking to replace the value. But I am not able to do that.
Can anyone tell me how to achieve this. How can I loop every Procedure tag
and and append the attrProc attribute value in a sequential order?
Thanks,
BR,
Varun
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--