Convert an XML object back into a string in ColdFusion

Posted by jpmyob on Stack Overflow See other posts from Stack Overflow or by jpmyob
Published on 2012-09-20T20:21:39Z Indexed on 2012/09/20 21:38 UTC
Read the original article Hit count: 243

Filed under:
|

In ColdFusion, I can parse a string of XML formatted data into an XML Object using xmlParse(). How can I convert it back into a string?

When I tried using toString() it throws an error that "it can't convert complex object to simple objects....", which is ironic because that's what it's supposed to do.

I need to use XMLTransform() which requires the first argument to be an xml string. But I also need to use xmlSearch() to get a node to pass into my transform, and xmlSearch returns an xmlObject. So now I need to put that object back into xml string format to pass into xmlTransform.

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about xml-parsing