boxuk / jslint-jenkins-plugin

Runs JSLint on a project and outputs in the Checkstyle format.
13 stars 15 forks source link

The generated XML file can be invalid #2

Closed Hagendorn closed 12 years ago

Hagendorn commented 12 years ago

When the JSLint error message contains a "&" or "<" char the generated XML file is invalid.

For example when JSLint finds an issue which creates one of these error messages:

An invalid xml file is created:

<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="1.3.3">
 <file name="/var/lib/jenkins/jobs/test/workspace/test.js">
  <error line="38" column="56" severity="error" message="Unexpected use of '&'." source="jslint"/>
  <error line="38" column="64" severity="error" message="Unexpected use of '<<'." source="jslint"/>
 </file>
</checkstyle>

The chars "<" and "&" are strictly illegal in XML these should be replaced with "<" and "&"

gavD commented 12 years ago

Many thanks, I will attempt to get a patch in for this in the next 24 hours - hopefully tomorrow I'll have a change to look at this

Hagendorn commented 12 years ago

That would be great! Thanks!

gavD commented 12 years ago

This should now be working as of ef857c933a73fc7b2ecdcb60c94ce7b8e8a372b3 - please update to HEAD. I'm still working on #1 - I still cannot reproduce it unfortunately