Sign in to follow this  
Stofolus

Links To Xml Can't Handle Ampersands

Recommended Posts

We are trying to upgrade from 3.2.1-release to 3.2.3-sr3.5347 but we're running into a problem with some of the data urls.

 

If we have a link that it something like this http://mypage.com/getXML?id=a&b it's then encoded and the attributes are double encoded so the & turns into a %2526.

 

Still when it's sent to fusioncharts it's completely decoded and then everything is encoded once and the b is then translated as an extra parameter instead of a value.

 

Any ideas on how we can get around this issue?

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Can you please explain the scenario, a bit more?

 

Where did you get this issue? Can you paste your sample code and XML here?

Share this post


Link to post
Share on other sites

Hi,

 

Can you please explain the scenario, a bit more?

 

Where did you get this issue? Can you paste your sample code and XML here?

 

I run fc.setData("http://mypage.com/getXML?id=a%2526b");

 

And in the debug window i get

 

dataURL provided: http://mypage.com/getXML?id=a%2526b

 

dataURL invoked: http://mypage.com/getXML?id=a&b

 

since & is a parameter delimiter in the URL this will change the parameter list from

 

id: a&b

 

To

 

id: a

b:

 

so because of this the xml cannot be found.

 

It seems to be decoding the URL one to many times

Share this post


Link to post
Share on other sites

Hi

 

I can't send you our code but here's the javascript we use:

 

var myChart8170 = new FusionCharts(
"/dev/FusionCharts/MSCombiDY2D.swf", 
"myChartId8170", 
"1111", 
"490", 
"1", 
"1",
   {wMode : "transparent"}
);
myChart8170.render("chartdiv8170");
myChart8170.setDataURL("[url="http://mypage.com/getXML?id=a%2526b"]http://mypage.com/getXML?id=a%2526b[/url]");

 

I can't get you any serverside code but what getXML does is take the parameter id and the value has to be "a&b" (without quotes). The problem is that it splits the value "a&b" at the &. Have in mind that this does work as it should in version 3.2.1

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Please note, setDataURL method is a deprecated method.

 

Try using setXMLData method.

Share this post


Link to post
Share on other sites

Hi,

 

Please note, setDataURL method is a deprecated method.

 

Try using setXMLData method.

 

We have that that too, it gives the same result. There isn't anything wrong with the way we're using fusioncharts because if we specify a URL without any special characters it works.

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