Subject: | Ampersand in field names causes XML error |
Thanks, Leo, for a very useful module. I maintain
Catalyst::View::PNGTTGraph which depends on your module.
When fields in the input fields list are passed in your constructor, if
they have an ampersand, I get an XML error as follows:
XML Parsing Error: not well-formed
Location: http://localhost:5000/chart/pie_graph
Line Number 1210, Column 77: <text x="47" y="74" class="keyText"
style="text-anchor: start">Bar&Bender [125] </text>
-------------------------------------------------------------------------------------------------^
The ampersand seems to cause the XML parser to expect a special XML
character code. I assume that if someone is passing an ampersand, they
want it to show up as such in the labels. I've added a patch to change
ampersands to &
Thanks again for a handy module!
Subject: | Graph.pm.patch |
154c154
< @new_data{@{$self->{'config'}->{'fields'}}} = @{$conf->{'data'}};
---
> @new_data{ map { s/&/&/ } @{$self->{'config'}->{'fields'}}} = @{$conf->{'data'}};