[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

: Need help with merging two common tags of multi

Subject: : 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
 : Need help with merging two common tags of multi
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.