FusionCharts Forum: setDataXML says "Invalid XML data" for valid XML that works with setDataURL - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

setDataXML says "Invalid XML data" for valid XML that works with setDataURL

#1 User is offline   nickpdx 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: 22-March 07

Posted 04 April 2007 - 12:19 PM

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.

Attached File(s)


0

Other Replies To This Topic

#2 User is offline   nickpdx 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: 22-March 07

Posted 04 April 2007 - 01:04 PM

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.
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic