Affects PMD Version:
6.4.0
Description:
In 079fc1c (for issue #538) an xml schema was added to the xml renderer reports. Unfortunately, that means the xpaths in the xslt files (in pmd-core/etc/xslt
) no longer match, resulting in just broken text output. The fix is to either:
p
) and add xmlns:p="http://pmd.sourceforge.net/report/2.0.0"
to the <stylesheet>
element; orxpath-default-namespace="http://pmd.sourceforge.net/report/2.0.0"
Code Sample demonstrating the issue:
Eg, using the saxon packaged with 6.4.0 and the current master xslt file on an xml report (the warning can be ignored):
$ java -jar ~/pmd-bin-6.4.0/lib/saxon-9.1.0.8.jar pmd.xml ~/src/pmd/pmd-core/etc/xslt/only-prio1.xslt > p1.html
Warning: at xsl:stylesheet on line 3 column 80 of only-prio1.xslt:
Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
$ more p1.html
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Each class should declare at least one constructor
Header comments are required
Comment is too large: Line too long
...(etc)
If we update the stylesheet to v2.0 and add xpath-default-namespace
:
$ vi ~/src/pmd/pmd-core/etc/xslt/only-prio1.xslt
$ java -jar ~/pmd-bin-6.4.0/lib/saxon-9.1.0.8.jar pmd.xml ~/src/pmd/pmd-core/etc/xslt/only-prio1.xslt > p1-fixed.html
$ more p1-fixed.html
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PMD 6.4.0 Report</title><script type="text/javascript" src="fcoltable.js"></script><style type="text/css">
@import "fcoltable.css";
(etc)
Running PMD through: CLI or Ant (probably anywhere though)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4