Sign in to follow this  
Guest Basundhara Ghosal

Invalid XML Data

Recommended Posts

I have a file data.xml (attached) that I am using as a data source. When calling RenderChartHTML with strURL populated all works as expected and I get my chart. If I try to read in that same file and use it as strXML I get an "Invalid XML Data" error. I have stripped it down to only relevant lines. Here is the code behind:

 

 

 


public string GetChartHtml()

{

 TextReader tr = new StreamReader(Server.MapPath("data.xml"));

 String xmlStringFromFile = tr.ReadToEnd();

 tr.Close();



 //return FusionCharts.RenderChartHTML("/FusionCharts/Charts/MSColumn3D.swf", "data.xml", "", "chartDiv", "600", "300", false);

 return FusionCharts.RenderChartHTML("/FusionCharts/Charts/MSColumn3D.swf", null, xmlStringFromFile, "chartDiv", "600", "300", false);

}

 

 

 

If you could point to what I am doing incorrectly I would greatly appreciate it.

 

 

 

Thanks,

 

Erik

data.xml

Edited by Guest

Share this post


Link to post
Share on other sites

OK, I have it. The double quotes in the <xml> line of data.xml messed things up when the dataXML parameter is written to the <EMBED> tag.

 

Problem solved. Perhaps this can help someone else.

 

Take care,

Erik

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Could you please confirm whether your issue is resolved ar you are still facing it?

Awaiting your reply.

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

We are glad that your issue is resolved.

Keep smiling and keep FusionCharting. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this