create a new node first and then extract the values from one doc and
populate the second.
Ade
-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED]
Sent: 02 September 2004 20:04
To: CF-Talk
Subject: RE: XML parsing in ColdFusion
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]

