This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

[refactor] moved thead and tbody deletion into xslt transformation.

Doing so with string manipulation leads to problems with unicode glyphs
that are not within latin1
  • Loading branch information...
1 parent 145de8b commit 9485aeb36b31473e8ba2d5d339e961eb0fd21bb2 @smee committed Jun 22, 2010
@@ -58,17 +58,6 @@ public ContentCaptureServletResponse(final HttpServletResponse resp) {
return buffer.toByteArray();
}
- /**
- * @return
- */
- public String getContent() {
- if (writer != null) {
- writer.flush();
- }
- // Flying saucer doesn't like thead or tbody, so let's just strip them
- return new String(buffer.toByteArray()).replaceAll("<thead>|</thead>|<tbody>|</tbody>", "");
- }
-
/*
* (non-Javadoc)
*
@@ -71,4 +71,12 @@
</style>
</xsl:element>
</xsl:template>
+
+ <!-- Flying saucer seems to have trouble with thead and tbody, strip them from the html. -->
+ <xsl:template match="thead">
+ <xsl:apply-templates/>
+ </xsl:template>
+ <xsl:template match="tbody">
+ <xsl:apply-templates/>
+ </xsl:template>
</xsl:stylesheet>

0 comments on commit 9485aeb

Please sign in to comment.