setDataXML says "Invalid XML data" for valid XML that works with setDataURL
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



setDataXML says "Invalid XML data" for valid... Expand / Collapse
Author
Message
Posted 4/4/2007 12:19:23 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 4/11/2007 11:57:21 AM
Posts: 15, Visits: 30
I have been using the setDataURL method to load charts, but I wanted to switch because I want to further process the chart's XML using JavaScript; I want to get the returned XML, hand it to my chart using setDataXML(), then hand it to further processes.

But setDataXML() complains for every one of my charts, "Invalid XML data." I am attaching the captured XML exactly as it is returned from an ajaxy-type server call. I'm handing it to setDataXML() as a string, so the contents of that string should be exactly equal to what's in the attachment. That said, I fail to see how it's invalid XML.

I have tried removing all newline characters; and removing the link attribute which contains the only characters that are even slightly different (encoded entities) - but those entity encodings still make valid XML. Like I said, this exact same XML when returned via setDataURL() is accepted by the chart just fine.


  Post Attachments 
example xml.txt (13 views, 479 bytes)
Post #742
Posted 4/4/2007 1:04:20 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 4/11/2007 11:57:21 AM
Posts: 15, Visits: 30
I found the cause of this issue thru trial and error...

As it turns out, if you call setDataXML() _before_ calling render(), you must escape the XML string using javascript's escape() function. If you later call setDataXML() on the resulting embedded flash object, you don't have to escape the XML.

I don't think this is covered in the documentation, I know that no discussion of escape() exists in the v3 docs section Web Developers > FusionCharts and Javascript.
Post #743
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 2:50pm


Execution: 0.094.