Skip to content

Commit

Permalink
Fix for POI's w:val=on|off, see #585
Browse files Browse the repository at this point in the history
  • Loading branch information
plutext committed Nov 29, 2024
1 parent 60a7c0c commit 0a82e19
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,18 @@
<xsl:template match="w:unhidenWhenUsed" > <!-- BIRT typo -->
<w:unhideWhenUsed/>
</xsl:template>

<!-- POI writes 'on' and 'off', no good for docx4j; see https://github.com/plutext/docx4j/issues/585 -->
<xsl:template match="@w:val" >
<xsl:choose>
<xsl:when test=".='true' or .='on' or .='1'">
<xsl:attribute name="w:val">true</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="w:val">false</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


</xsl:stylesheet>

0 comments on commit 0a82e19

Please sign in to comment.