BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to merge two XML class together?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML
View previous topic :: View next topic  
Author Message
Sherlyn
Guest





PostPosted: Wed Mar 28, 2007 1:16 pm    Post subject: How to merge two XML class together? Reply with quote



Hi!

I used xml data binding to generate a xml class which called
TXMLCatalogType and I have two xml files which have same xml structure.
How do I merge two xml files' data together in one TXMLCatalogType class?

Example:

function GetXML: IXMLCatalogType;
var C1, C2: IXMLCatalogType;
begin
C1 := GetCatalog('C:\file1.xml');
C2 := GetCatalog('C:\file2.xml');

//how to merge C1 and C2 in one TXMLCatalogType class ?
end;

I knew this can be achieved by the following code:-

for i := 0 to C2.Count - 1 do
C1.ChildNodes.Add(C2.ChildNodes[i]);

But is there any ready function that i can use to merge two document
together?

Thanks in advance.

From,
Sherlyn Chew
Back to top
ScotDance
Guest





PostPosted: Wed Mar 28, 2007 2:50 pm    Post subject: Re: How to merge two XML class together? Reply with quote



Hi
Have a look here I had a similar problem last summer.

http://www.experts-exchange.
COM/Programming/Languages/Pascal/Delphi/Q_21870999.html
or
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/Q_21918200.html

They both refer to same question.

SD

"Sherlyn" <sherlyn (AT) estream (DOT) com.my> wrote in message
news:460a2441 (AT) newsgroups (DOT) borland.com...
Quote:
Hi!

I used xml data binding to generate a xml class which called
TXMLCatalogType and I have two xml files which have same xml structure.
How do I merge two xml files' data together in one TXMLCatalogType class?

Example:

function GetXML: IXMLCatalogType;
var C1, C2: IXMLCatalogType;
begin
C1 := GetCatalog('C:\file1.xml');
C2 := GetCatalog('C:\file2.xml');

//how to merge C1 and C2 in one TXMLCatalogType class ?
end;

I knew this can be achieved by the following code:-

for i := 0 to C2.Count - 1 do
C1.ChildNodes.Add(C2.ChildNodes[i]);

But is there any ready function that i can use to merge two document
together?

Thanks in advance.

From,
Sherlyn Chew
Back to top
Sherlyn
Guest





PostPosted: Thu Mar 29, 2007 6:02 am    Post subject: Re: How to merge two XML class together? Reply with quote



Hi!

Thanks for the links you gave me. But I want to merge two xml by xml
data binding class and not XSL. Anyhow thanks for providing me this
solution. I'm really appreciate it.

From,
Sherlyn Chew

ScotDance wrote:
Quote:
Hi
Have a look here I had a similar problem last summer.

http://www.experts-exchange.
COM/Programming/Languages/Pascal/Delphi/Q_21870999.html
or
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/Q_21918200.html


They both refer to same question.

SD
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.