 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Sherlyn Guest
|
Posted: Wed Mar 28, 2007 1:16 pm Post subject: How to merge two XML class together? |
|
|
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
|
Posted: Wed Mar 28, 2007 2:50 pm Post subject: Re: How to merge two XML class together? |
|
|
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
|
Posted: Thu Mar 29, 2007 6:02 am Post subject: Re: How to merge two XML class together? |
|
|
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:
|
|
| Back to top |
|
 |
|
|
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
|
|