开发者

How do I encode a single quote so it shows up in the label of a Fusion Chart's value?

开发者 https://www.devze.com 2023-01-20 08:19 出处:网络
I\'m getting an \'Invalid XML Data\' error for any Fusion Chart which contains a \' (ie. single quote) in the label name for data.

I'm getting an 'Invalid XML Data' error for any Fusion Chart which contains a ' (ie. single quote) in the label name for data.

This happens even when I encode/escape the single quote.

Try the following Chart Data:

Obviously when unescaped (as such) we should see an error

<chart shownames='1' caption='Registrant Types'>
    <set value='2' color='AFD8F8' label='Justin's Test'/>
    <set value='3' color='F6BD0F' label='No quote'/>
</chart>

However I would expect that if I encode the quote as fol开发者_Go百科lows it should work

<chart shownames='1' caption='Registrant Types'>
    <set value='2' color='AFD8F8' label='Justin%27s Test'/>
    <set value='3' color='F6BD0F' label='No quote'/>
</chart>

The only way I can get it to work is by removing the ' altogether.


Try:

<set value='2' color='AFD8F8' label='Justin&quot;s Test'/>
0

精彩评论

暂无评论...
验证码 换一张
取 消