I got two xml files named A.xml and B.Xml, What I like to do is to append the
B.xml to A.xml,
But It seem to me that I am missing something from my code or I am just off the
based.
Any suggestions?
----> here is A.XML
<?xml version="1.0" encoding="UTF-8"?>
<xWindow>
<General>
<Name>Space Center</Name>
<BackIndex>1</BackIndex>
</General>
</xWindow>
----> here is B.XML
<?xml version="1.0" encoding="UTF-8"?>
<GroupA>
<Source>
<URLSource>http://www.test.com</URLSource>
<URLTable>CiCo</URLTable>
</Source>
</GroupA>
-----> Here is what I want
<xWindow>
<General>
<Name>Space Center</Name>
<BackIndex>1</BackIndex>
</General>
<GroupA>
<Source>
<URLSource>http://www.test.com</URLSource>
<URLTable>CiCo</URLTable>
</Source>
</GroupA>
</xWindow>
here is what I am trying to do:
<cffile action="READ" file="a.xml" variable="v_xmlCode1">
<cffile action="READ" file="b.xml" variable="v_xmlCode2">
<cfset v_xmlDoc1 = xmlParse(v_xmlCode1)>
<cfset v_xmlDoc2 = xmlParse(v_xmlCode2)>
<cfset root1 = v_xmlDoc1.xmlRoot>
<cfset root2 = v_xmlDoc2.xmlRoot>
<cfset ArrayAppend(root1.XmlChildren, XmlElemNew(v_xmlDoc2,#root2#))>
<cfdump var="#root2#">
<cfabort>
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]