Coldfusion XML objects can be manipulated by the native coldfusion
struct and array methods, depending on the xml parts you wish to
manipulate.

Full list of native functions is here:
http://www.co.multnomah.or.us/cfdocs/Developing_ColdFusion_MX_Applications_with_CFML/XML7.html

On Mar 4, 6:17 am, BarryC <[email protected]> wrote:
> Hi,
>
> I've hunted around for a solution to this but haven't found a simple
> or clean one (maybe there isn't one) but maybe someone here has some
> suggestions.
>
> I have twoXMLobjects and I want to take anXMLnode from one and
> insert it into the other
>
> XMLObject 1:
> <?xmlversion="1.0" encoding="UTF-8"?>
> <styles>
>   <style>
>     <property>background</property>
>     <value>#FFFFFF</value>
>   </style>
> </styles
>
> XMLObject 2:
> <?xmlversion="1.0" encoding="UTF-8"?>
> <styles>
>  <style>
>     <property>border-color</property>
>     <value>#00A0AF</value>
>   </style>
> </styles>
>
> I want to take the <style> node inXMLObject 2 andadd/insert it intoXMLObject 
> 1 so I end up with this result:
>
> <?xmlversion="1.0" encoding="UTF-8"?>
> <styles>
>   <style>
>     <property>background</property>
>     <value>#FFFFFF</value>
>   </style>
>  <style>
>     <property>border-color</property>
>     <value>#00A0AF</value>
>   </style>
> </styles>
>
> You can't do a direct assignment like this:
> <cfset
> arrayAppend(xmlObj1.styles.XMLChildren,xmlObj2.styles.XMLChildren[1])>
> as it complains with the message:WRONG_DOCUMENT_ERR: A node is used in
> a different document than the one that created it.
>
> There doesn't seem to be any simple examples on how to use
> XmLElemNew() to create a copy of a node easily it looks like you'd
> have to manually iterate through the element attributes and set them.
>
> Thanks
> Barry

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to