Summary: | Build fails if Saxon 9 is on Ant's classpath | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Michael Osipov <michaelo> |
Component: | Packaging | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: | Build failure logfile |
Description
Michael Osipov
2011-04-06 05:13:52 UTC
Which version of Tomcat7 ? I've had a look at the file in SVN and the current XSL code does not match what you are reporting. What does the $Id line near the top of the XSL file say? It should start like this: <!-- $Id: tomcat-docs.xsl Reduce severity since, assuming this issue is valid, there is a simple workaround (remove Saxon from Ant's classpath). (In reply to comment #1) > Which version of Tomcat7 ? > > I've had a look at the file in SVN and the current XSL code does not match what > you are reporting. > > What does the $Id line near the top of the XSL file say? > It should start like this: > > <!-- $Id: tomcat-docs.xsl SVN revision is 1089355 $Id$ of file is <!-- $Id: tomcat-docs.xsl 1036949 2010-11-19 17:18:04Z markt $ --> (In reply to comment #2) > Reduce severity since, assuming this issue is valid, there is a simple > workaround (remove Saxon from Ant's classpath). This cannot be done unless you have root priviliges on the System to modify the global installation. Eventhough if I had, the removal would affect others. (In reply to comment #1) > Which version of Tomcat7 ? > > I've had a look at the file in SVN and the current XSL code does not match what > you are reporting. > > What does the $Id line near the top of the XSL file say? > It should start like this: > > <!-- $Id: tomcat-docs.xsl I am building from trunk. The relevant part of the log file says: [xslt] Processing E:\Projekte\tomcat-trunk\webapps\docs\changelog.xml to E:\Projekte\tomcat-trunk\output\build\webapps\docs\changelog.html [xslt] E:\Projekte\tomcat-trunk\webapps\docs\tomcat-docs.xsl:470: Fatal Error! Illegal HTML character: decimal 150 Line 470 of tomcat-docs.xsl is <xsl:template match="changelog/fix"> <tr> <xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/fix.gif</xsl:variable> <td><img alt="fix" class="icon" src="{$src}"/></td> <td><xsl:apply-templates/></td> <!-- 470 --> </tr> </xsl:template> The character 150 is clearly not present in the XSL file. The Saxon error message is somewhat misleading, as the invalid character seems to be in changelog.xml at line 1488: <bug>49428</bug>: Re-implement the fix for bug <bug>49428</bug> – Perhaps you can try temporarily editting that out, and see if that makes Saxon happy. (In reply to comment #6) > The relevant part of the log file says: > > [xslt] Processing E:\Projekte\tomcat-trunk\webapps\docs\changelog.xml to > E:\Projekte\tomcat-trunk\output\build\webapps\docs\changelog.html > [xslt] E:\Projekte\tomcat-trunk\webapps\docs\tomcat-docs.xsl:470: Fatal > Error! Illegal HTML character: decimal 150 > > Line 470 of tomcat-docs.xsl is > > <xsl:template match="changelog/fix"> > <tr> > <xsl:variable name="src"><xsl:value-of > select="$relative-path"/>/images/fix.gif</xsl:variable> > <td><img alt="fix" class="icon" src="{$src}"/></td> > <td><xsl:apply-templates/></td> <!-- 470 --> > </tr> > </xsl:template> > > The character 150 is clearly not present in the XSL file. > The Saxon error message is somewhat misleading, as the invalid character seems > to be in changelog.xml at line 1488: > > <bug>49428</bug>: Re-implement the fix for bug <bug>49428</bug> – > > Perhaps you can try temporarily editting that out, and see if that makes Saxon > happy. Sebb, I removed the suspicious ref and it worked. I started digging and realized that the document is really broken. In contrast to the built-in Xalan Saxon is not lenient and strictly follows the specs. The change was made by Konstantin, he doesn't seem to be encoding-savvy. If you check the changelog.xml's encoding, you'll see UTF-8 is set in the XML prolog. The entity ref '–' (0x96, char 'en dash') (http://en.wikipedia.org/wiki/Dash#Common_dashes) does only exist in Windows 1252 (http://en.wikipedia.org/wiki/Windows-1252#Codepage_layout) but translated to Unicode, this is a contol char which is forbidden in XML. To make this work, you have to reference a valid Unicode char. In this case it would be '–' (U+2013) see http://www.utf8-zeichentabelle.de/unicode-utf8-table.pl?start=8192 I changed that and 'ant release' ran perfectly. I guess this is a really simple fix in SVN and the build should work on both XSLT processors. |