Hi guys,
I have created an aspx page which dynamicaly creates an xml string and posts it back to the client.
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "text/xml";
Response.ContentEncoding = Encoding.UTF8;
var flashAssets = Asset.GetScrollingFlashAssets();
var xmlResponse = new StringBuilder(@"<?xml version=""1.0"" encoding=""UTF-8"" ?><assets>");
flashAssets.ForEach(asset => xmlResponse.Append(@"<asset>handlers/ImageHandler.ashx?liAssetID=" + asset.AssetID + "</asset>"));
xmlResponse.Append("</assets>");
Response.Write(xmlResponse.ToString());
}
It creates valid XML and when I save this code to a static .xml file the flash can read it fine, though when it tried to read it from the ASPX it fails with "1090 XML parser failure: element is malformed".
I do not have http compression on.
Flash code.
//---------loading the external xml file-------
var urlRequest:URLRequest = new URLRequest("../xml/CaseStudyFlashAssets.aspx");
var urlLoader:URLLoader = new URLLoader();
var myXML:XML = new XML();
var xmlList:XMLList;
myXML.ignoreWhitespace = true;
urlLoader.addEventListener(Event.COMPLETE,fileLoaded);
urlLoader.load(urlRequest);
Any ideas?