Possible gotcha with the XML class, but I’d like to get this confirmed if anyone has a second to try this out.

It seems that the XML class is converting " to its literal ASCII representation (i.e. the quote mark ) when converting a String into a new XML object. I’m sending this data over XML-RPC and I cannot have quotes being sent as plain-text, they need to be XML/HTML encoded.

Here’s a quick test that shows it:

var str:String = "<string>Here is some text, with an image...
&lt;img src=&quot;http://www.google.co.uk/intl/en_uk/images/
logo.gif&quot; /&gt;</string>";

var xml:XML = new XML( str );
trace( xml );

At this point I’d be sending the xml object over the wire with HTTPService. The problem is that trace()/Charles/Fiddler etc is showing that the " is being converted to a real quote (literal) and that can cause a problem with the server which wants encoded copy, and being XMLRPC, I cannot use CDATA in this case. This is not the same behaviour as appears in Flash 8, it also appears that it differs when compiling with the Flex SDK and the Flash CS3 IDE in terms of whether it also turns the < and > entities to their literal representations.

Does anyone know a workaround for this? Can it be expected behaviour? I think I’ll have to be sending things as a string internally to avoid the problem for now but it would be good to hear other opinions.