Skip Menu |

This queue is for tickets about the XML-Simple CPAN distribution.

Report information
The Basics
Id: 16881
Status: resolved
Priority: 0/
Queue: XML-Simple

People
Owner: Nobody in particular
Requestors: thierer [...] web.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.14
Fixed in: (no value)



Subject: XMLout should encode ' as '
While XMLout escapes to '<', '>', '&' and '&quot', it doesn't escape ' to ''' This leads to an error when reading back such a file with XMLin.
This is by design and not a bug. It is not necessary to escape every instance of a ' or a " character in an XML document. It is necessary to escape a quote character in the value of an attribute, but only if the quote character matches the attribute value delimiter. For example: <book publisher='O&apos;Reilly'> However, since XML::Simple always uses double quotes for attributes, it never needs to escape single quotes. This is still well-formed XML: <book publisher="O'Reilly"> If you prefer to have your single quote characters escaped, you can create your own class which inherits from XML::Simple, but overrides the escape_value() method. Your bug report suggests that not escaping single quotes leads to errors from XMLin, but you didn't include the error. Cheers Grant