Help in merging 2 or more xml's

Discussion in 'XML' started by Ked, Aug 18, 2004.

  1. Ked

    Ked Guest

    Any help in this matter will be gr8!!

    I have 1 XML file:

    I am giving the example:

    <emails>
    <email>
    <clients>
    <client>
    <clientId>12345</clientId>
    <extClientId>34567</extClientId>
    </client>
    </clients>
    <emailaddress></emailaddress>
    <MailingPreference>Weekly once<MailingPreference>
    </email>
    <email>
    <clients>
    <client>
    <clientId>35690</clientId>
    <extClientId>455454</extClientId>
    </client>
    </clients>
    <emailaddress></emailaddress>
    <MailingPreference>Weekly once<MailingPreference>
    </email>
    <email>
    <clients>
    <client>
    <clientId>544554</clientId>
    <extClientId>98725</extClientId>
    </client>
    </clients>
    <emailaddress></emailaddress>
    <MailingPreference>Weekly once<MailingPreference>
    </email>

    </emails>

    I would like to merge these 2 XML structures. Do observe that the
    clients tag information is different for first 2 XML structures, but
    rest is the same. Hence I would like to merge them together. 3rd
    structure has completely different info. hence keep it seperate.

    Basically I would like to get a XML like:
    <emails>
    <email>
    <clients>
    <client>
    <clientId>12345</clientId>
    <extClientId>34567</extClientId>
    </client>
    <client>
    <clientId>35690</clientId>
    <extClientId>455454</extClientId>
    </client>
    </clients>
    <emailaddress></emailaddress>
    <MailingPreference>Weekly once<MailingPreference>
    </email>
    <email>
    <clients>
    <client>
    <clientId>544554</clientId>
    <extClientId>98725</extClientId>
    </client>
    </clients>
    <emailaddress></emailaddress>
    <MailingPreference>Weekly once<MailingPreference>
    </email>
    </emails>

    Is it possible?..Can anyone suggest a quick solution. Thanks a lot in
    advance!!
     
    Ked, Aug 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    3
    Views:
    697
    Oliver Wong
    Mar 31, 2006
  2. Michael
    Replies:
    4
    Views:
    437
    Matt Hammond
    Jun 26, 2006
  3. Replies:
    2
    Views:
    17,378
    Philippe Poulard
    Aug 24, 2006
  4. Tine Müller
    Replies:
    3
    Views:
    373
    Tine Müller
    Apr 30, 2008
  5. Robert Klemme

    With a Ruby Yell: more, more more!

    Robert Klemme, Sep 28, 2005, in forum: Ruby
    Replies:
    5
    Views:
    224
    Jeff Wood
    Sep 29, 2005
Loading...

Share This Page