Subject: [xsl] [xsl]: Need help with merging two common tags of multiple xmls From: "varun bhatnagar varun292006@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 11 Aug 2014 08:48:45 -0000 |
Hi, I am still stuck with this problem while trying to merge two common tags in multiple xmls. Every xml file has 4 sections: 1) systemInfo 2) systemInitialization 3) Procedure 4) systemWrapup I have written rules for merging systemInfo systemInitialization and systemWrapup sequentially. As they appear just once in my xmls there is no problem. I am stuck with Procedure tag as they may appear more than once and I have to merge it sequentially by taking out from both the files and modifying its attributes. How can I achieve the output? *File1.xml* <?xml version="1.0" encoding="ASCII"?> <System saSysName="AppSysCyborg"> <systemInfo> <systemPeriod sysExpectedTime="600000000"/> <configurationBase sysBase="0" /> </systemInfo> <systemInitialization> <addToSys> .......................... .......................... </addToSys> </systemInitialization> <Procedure procName="Proc1" procLevel="1"> <outageInfo> <procedurePeriod sysPeriod="100000000"/> </outageInfo> <sysAction> <immCCB ccbFlags="0"> <create objectClassName="sysApplication"> <attr name="sysAppl" type="hvm"> <val>1</val> </attr> </create> </immCCB> </sysAction> </systemInstall> </Procedure> <Procedure sysSmfProcedure="Proc2" sysExecLevel="2"> <outageInfo> <procedurePeriod sysPeriod="100000000"/> </outageInfo> <sysAction> <sysCB ccbFlags="0"> <create objectClassName="sysApplication"> <attr name="sysAppl" type="hvm"> <val>1</val> </attr> </create> </sysCB> </sysAction> </Procedure> <systemWrapup> .......................... .......................... </systemWrapup> </System> *File-2.xml* <?xml version="1.0" encoding="ASCII"?> <System saSysName="Term-1"> <systemInfo> <systemPeriod sysExpectedTime="600000000"/> <configurationBase sysBase="0" /> </systemInfo> <systemInitialization> <addToSys> .......................... </addToSys> </systemInitialization> <Procedure procName="Proc1" procLevel="1"> <outageInfo> <procedurePeriod sysPeriod="100000000"/> </outageInfo> <sysAction> <immCCB ccbFlags="0"> <create objectClassName="sysApp"/> </immCCB> </sysAction> <systemInstall/> </Procedure> <Procedure procName="Proc2" procLevel="2"> <outageInfo> <procedurePeriod sysPeriod="100000000"/> </outageInfo> </Procedure> <Procedure procName="Proc3" procLevel="3"> <outageInfo> <procedurePeriod sysPeriod="100000000"/> </outageInfo> </Procedure> <systemWrapup> .......................... .......................... </systemWrapup> </System> *Output.xml* <?xml version="1.0" encoding="ASCII"?> <System saSysName="AppSysCyborg"> <systemInfo> <systemPeriod sysExpectedTime="600000000"/> <configurationBase sysBase="0" /> </systemInfo> <systemInitialization> <addToSys> ...... .......... </addToSys> <addToSys> .......................... .......................... .......................... </addToSys> <sysInit> .......................... .......................... </sysInit> <sysInit> .......................... .......................... </sysInit> </systemInitialization> *<Procedure procName="Proc1" procLevel="1">* * <outageInfo>* * <procedurePeriod sysPeriod="100000000"/>* * </outageInfo>* * <sysAction>* * <immCCB ccbFlags="0">* * <create objectClassName="sysApplication">* * <attr name="sysAppl" type="hvm">* * <val>1</val>* * </attr>* * </create>* * </immCCB>* * </sysAction>* * </Procedure>* * <Procedure procName="Proc2" sysExecLevel="2">* * <outageInfo>* * <procedurePeriod sysPeriod="100000000"/>* * </outageInfo>* * <sysAction>* * <sysCB ccbFlags="0">* * <create objectClassName="sysApplication">* * <attr name="sysAppl" type="hvm">* * <val>1</val>* * </attr>* * </create>* * </sysCB>* * </sysAction>* * </Procedure> * *<Procedure procName="Proc1" procLevel="3">* * <outageInfo>* * <procedurePeriod sysPeriod="100000000"/>* * </outageInfo>* * <sysAction>* * <immCCB ccbFlags="0">* * <create objectClassName="sysApp"/>* * </immCCB>* * </sysAction>* * <systemInstall/>* * </Procedure>* * <Procedure procName="Proc2" procLevel="4">* * <outageInfo>* * <procedurePeriod sysPeriod="100000000"/>* * </outageInfo>* * <sysAction>* * <sysCB ccbFlags="0">* * <create objectClassName="sysApplication">* * <attr name="sysAppl" type="hvm">* * <val>1</val>* * </attr>* * </create>* * </sysCB>* * </sysAction>* * </Procedure>* * <Procedure procName="Proc3" procLevel="3">* * <outageInfo>* * <procedurePeriod sysPeriod="100000000"/>* * </outageInfo>* * </Procedure> * * <Procedure procName="Proc4" procLevel="5">* * <outageInfo>* * <procedurePeriod sysPeriod="100000000"/>* * </outageInfo>* * </Procedure> * <systemWrapup> .......................... .......................... </systemWrapup> </System> Thanks, Varun
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Implementations of Binary, Jirka Kosek jirka@xx | Thread | [xsl] Pattern notation for precedin, Heiko Niemann kontak |
Re: [xsl] Implementations of Binary, John Lumley john.lum | Date | Re: [xsl] Implementations of Binary, Jirka Kosek jirka@xx |
Month |