summaryrefslogtreecommitdiffstats
path: root/JLanguageTool/src/rules/print-ff.xsl
blob: 38394da0c93eef8d6aaf962aceeac4c51d71f9f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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>