Thanks for your help so far. Let me give you some actual data so that it will be easy to interpret.
ROOT OBJECT KEY COLUMN OLD NEW EMPLOYEE EMPLOYEE XYZ TITLE <null> Mr EMPLOYEE EMPDETAILS DEF CITY California New York CUSTOMER CUSTOMER ABC CAPTION Regular Premium
File 2
EMPLOYEE EMPLOYEE NEW EMPLOYEE 1 EMPLOYEE EMPLOYEE NEW EMPLOYEE 9 EMPLOYEE EMPDETAILS NEW EMPLOYEE1-DETAILS EMPLOYEE EMPDETAILS NEW EMPLOYEE9-DETAILS EMPLOYEE EMPDETAILS NEW EMPLOYEE16-DETAILS
File 3
EMPLOYEE EMPLOYEE NEW EMPLOYEE 6 EMPLOYEE EMPDETAILS NEW EMPLOYEE6-DETAILS CUSTOMER CUSTOMER NEW CUSTOMER
So from these three files i wrote small perl program to generate the files in xml
<Data> <EMPLOYEE> <KEY name = 'XYZ'> <TITLE> <oldvalue></oldvalue> <newvalue>Mr</newvalue> </TITLE> </KEY> </EMPLOYEE> <EMPDETAILS> <KEY name = 'DEF'> <CITY> <oldvalue>California</oldvalue> <newvalue>New York</newvalue> </CITY> </KEY> </EMPDETAILS> <CUSTOMER> <KEY name = 'ABC'> <CAPTION> <oldvalue>Regular</oldvalue> <newvalue>Premium</newvalue> </CAPTION> </KEY> </CUSTOMER> </Data>
Output 2
<Data> <EMPLOYEE> <KEY>'NEW EMPLOYEE 1'</KEY> <KEY>'NEW EMPLOYEE 9'</KEY> </EMPLOYEE> <EMPDETAILS> <KEY>'NEW EMPLOYEE1-DETAILS'</KEY> <KEY>'NEW EMPLOYEE9-DETAILS'</KEY> <KEY>'NEW EMPLOYEE16-DETAILS'</KEY> </EMPDETAILS> </Data>
Output 3
<Data> <EMPLOYEE> <KEY>'NEW EMPLOYEE 6'</KEY> </EMPLOYEE> <EMPDETAILS> <KEY>'NEW EMPLOYEE6-DETAILS'</KEY> </EMPDETAILS> <CUSTOMER> <KEY>'NEW CUSTOMER'</KEY> </CUSTOMER> </Data>
Now i need to combine all these three into single output file. First field tells the root object. So for EMPLOYEE, i need to display details of EMPLOYEE and EMPDETAILS table what has been in one db, other db, and if exists in both db what are the old and new values (these all are created from perl program and it contains only delta information). Similary for CUSTOMER root object, i need to display all entities of this object and then what exists in one db,other db, modified information. There are many occurances of modified columns i.e. for each key several columns can be modified

There are no headers in any file. I have added one in first input for clarification


In reply to Re^2: XML File Creation in Perl by documents9900
in thread XML File Creation in Perl by documents9900

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.