Sign in to follow this  
marc33

Invalid data instead of a chart using a Dataurl value containing '&'

Recommended Posts

Hi,

 

I use the dataUrl parameter to render a chart using the multipleAxis swf. This works fine. Now I want to send a parameter to the server side script which retrieves the xml for the swf. This in order to create multiple charts for a single page request. To differentiate between charts I add "&id=" to the dataUrl parameter where is a uuid.

 

So my DataUrl parameter reads like this:

 

 

 

dataURL="http://pimso/coldboxproxy.cfc?method=getXmlData&id=550e8400-e29b-41d4-a716-446655440000"

 

 

 

Instead of a nice graph the swf now displays an "invalid xml data" error message.

 

 

 

This is strange because if I use the url by itself in a new tab the xml data loads with no problem.

 

So it is retrieved but the flash file refuses to read it.

 

 

 

I have no clue as to what may cause this but wonder -after quickly looking at another related post - if this has to do with the '&' in the url? If so, how can I use a parameter in calling the data for the swf file in the way described?

 

 

 

Thanks,

 

 

 

Marc

Share this post


Link to post
Share on other sites

Hi Marc,

 

If you get an "Invalid XML Data" message, it means that the XML data document is malformed. Check it for common errors like:

1. Differences in case of tags. e.g., <chart> should end with </chart> and not </Chart> or </CHART>

2. Missing opening/closing quotation marks for any attributes. e.g., <chart caption=Monthly Sales' ..> should be <chart caption='Monthly Sales' ..>

3. Missing closing tag for any element. e.g., <set label='Services' value='26' > should be <set label='Services' value='26' />

4. If you're using any special characters in your XML, make sure they're properly encoded. e.g., in dataXML method, % needs to be encoded as %25, & as %26 and so on. In dataURL method, you can provide most of the characters directly, without the need to encode.

5. In dataXML method, check for conflict of ' (XML Attribute Character) and " (HTML Parameter Character). e.g., if you're using direct HTML embedding method, and using " for HTML parameters, then you need to make sure that all your XML attributes use ' as containers.

In case the issue still persists, please send us the XML file that you are using, as an attachment.

Looking forward to your feedback.

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