diff options
author | Arno Teigseth <arno@teigseth.no> | 2011-02-05 08:48:27 +0000 |
---|---|---|
committer | Arno Teigseth <arno@teigseth.no> | 2011-02-05 08:48:27 +0000 |
commit | 4f3d565a5e5ede6eb6fd1f276d4e8ad37b67b5ce (patch) | |
tree | 7af736540eca93034428a975bd850e709fbbe2e5 /JLanguageTool/src/rules/print-ff.xsl | |
parent | ecaee85ab5984ebadd56721c295dc26b3335f7ce (diff) | |
download | grammar-norwegian-master.tar.gz grammar-norwegian-master.tar.bz2 grammar-norwegian-master.tar.xz |
Diffstat (limited to 'JLanguageTool/src/rules/print-ff.xsl')
-rw-r--r-- | JLanguageTool/src/rules/print-ff.xsl | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/JLanguageTool/src/rules/print-ff.xsl b/JLanguageTool/src/rules/print-ff.xsl new file mode 100644 index 0000000..38394da --- /dev/null +++ b/JLanguageTool/src/rules/print-ff.xsl @@ -0,0 +1,63 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + <!-- XSLT stylesheet to pretty print false-friends.xml + + usage: + + java -jar saxon8.jar false-friends.xml print-ff.xsl + + --> + <xsl:output method="html" encoding="UTF-8" indent="no" /> + + <xsl:template match="text()" /> + + <xsl:template match="token"> + <xsl:choose> + <xsl:when test="@negate='yes'"> + <strike> + <strong style="color: #339900;"> + <xsl:value-of select="translate(.,'|',',')" /> + <xsl:text> </xsl:text> + </strong> + </strike> + </xsl:when> + <xsl:otherwise> + <strong style="color: #339900;"> + <xsl:value-of select="translate(.,'|',',')" /> + <xsl:text> </xsl:text> + </strong> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="pattern"> + <xsl:apply-templates select="*"/> + (<xsl:value-of select="@lang"/>) + </xsl:template> + + <xsl:template match="//rule"> + <xsl:apply-templates select="*"/> + </xsl:template> + + <xsl:template match="translation"> + <ul> + <li> + <xsl:value-of select="."/> + <xsl:text> (</xsl:text><xsl:value-of select="@lang"/><xsl:text>)</xsl:text> + </li> + </ul> + </xsl:template> + + <xsl:template match="//rules"> + <html> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> + <body> + <xsl:apply-templates select="//rule"> + <xsl:sort select="pattern"/> + </xsl:apply-templates> + </body> + </html> + </xsl:template> + +</xsl:stylesheet>
\ No newline at end of file |