I suggest that create a new XML doc and place all the information form
bothe xml docs in the new one.

here is a sample bit of code that I use to create a xml object.

xmloutput = xmlnew();
xmloutput.XmlRoot = XmlElemNew(t.xmloutput,"entries");
xmloutput.entries.XmlChildren[1] = xmlelemnew(xmloutput,"entry");
xmloutput.entries.XmlChildren[1].xmltext = xmlformat("dude an entry");

As you can see you can treat the XmlChildren node as an array. loop
over the output from the two old XML files.

Hope it helps

Ian

----- Original Message -----
From: Ian Skinner <[EMAIL PROTECTED]>
Date: Thu, 2 Sep 2004 12:04:07 -0700
Subject: RE: XML parsing in ColdFusion
To: CF-Talk <[EMAIL PROTECTED]>

I'm still not getting this to work.  I tried using what you provided,
but I'm only getting errors like the following.

"WRONG_DOCUMENT_ERR: That node doesn't belong in this document."

"Error casting an object of type to an incompatible type. This
usually indicates a programming error in Java, although it could also
mean you have tried to use a foreign object in a different way than it
was designed."

My test code:

<cfxml variable="doc1">
<root>
<member id="10">
<name>Ian</name>
<sex>male</sex>
</member>
</root>
</cfxml>

<cfxml variable="doc2">
<root>
<member id="1">
<name>Joe</name>
<sex>male</sex>
</member>
<member id="2">
<name>John</name>
<sex>male</sex>
</member>
<member id="3">
<name>Sue</name>
<sex>female</sex>
</member>
</root>
</cfxml>

<!--- Three versions of this line I tried --->
<cfset doc2.root.xmlChildren[4] = xmlElemNew(doc1, "member")><!---
Alternate 1 --->
<cfset doc2.root.xmlChildren[4] = xmlElemNew(doc1.root,
"member")><!--- Alternate 2 --->
<cfset doc2.root.xmlChildren[4] = xmlElemNew(doc1.root.member,
"member")><!--- Alternate 3 --->

<!--- If I code the line this way, I don't get an error, I do get a
new member, but it is not populated.  If I could copy the member node
from doc 1 to this doc, then all would be well. But I can't seem to do
that.--->
<cfset doc2.root.xmlChildren[4] = xmlElemNew(doc2, "member")>

<cfdump var="#doc2 #" label="Doc Two">

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org

Sacramento, CA

"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to