Escaping of XML entities
Brought to you by:
alnd
XML entities, at least the "&" entity, are not escaped in XML output. This means that the XML written is not valid XML and thus cannot be read by normal XML parsers.
Sample output by the Java/Eclipse XML parser:
[Fatal Error] :23:112: The reference to entity "co" must end with the ';' delimiter.
To reproduce:
Create a project in which there are files with a name such as "foo&bar.sh", or in which the project name is "foo & bar". The resulting XML file will include "&" instead of "&".
Anonymous
...this should obviously read "instead of the XML entity "& amp ;""
Just ran into the same error with a " in a file name, which needs to be escaped by ".
svn commit 370 fixes XML encoding for the five characters listed at
http://en.wikipedia.org/wiki/Character_encodings_in_HTML#XML_character_references
Please run some tests using the development version of cloc from
https://sourceforge.net/p/cloc/code/HEAD/tree/trunk/cloc
v1.62 released