source: main/trunk/gli/help/gen-many-html.xsl@ 32138

Last change on this file since 32138 was 28528, checked in by kjdon, 10 years ago

changed the way we get java Dictionary extension - copied from tutorials code

  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xalan/java"
5 xmlns:dict="http://xml.apache.org/xalan/java/Dictionary"
6 extension-element-prefixes="java"
7 exclude-result-prefixes="java dict">
8
9 <xsl:output method="html" encoding="UTF-8"/>
10
11 <!-- <xsl:variable name="diction" select="java:Dictionary.new('en')"/>-->
12 <xsl:variable name="diction" select="dict:new('en')"/>
13
14 <xsl:template match="Document">
15 <xsl:for-each select="Section">
16 <xsl:call-template name="processSection">
17 <xsl:with-param name="sectionHead" select="position()"/>
18 </xsl:call-template>
19 </xsl:for-each>
20 </xsl:template>
21
22
23 <xsl:template match="Reference">
24 <xsl:variable name="target" select="@target"/>
25 <a href="{@target}.htm"><xsl:value-of select="/Document//Section[@name=$target]/Title/Text"/></a>
26 </xsl:template>
27
28
29 <xsl:template match="Section"/>
30
31
32 <xsl:template match="Title"/>
33
34 <xsl:template match="Text">
35 <p><xsl:apply-templates/></p>
36 </xsl:template>
37
38 <xsl:template name="processSection">
39 <xsl:param name="sectionHead"/>
40
41 <html>
42 <head>
43 <title>The Greenstone Librarian Interface - Help Pages</title>
44 </head>
45 <body bgcolor="#E0F0E0">
46 <table border="2" bgcolor="#B0D0B0" cellpadding="5" cellspacing="0" width="100%">
47 <tr>
48 <td align="center" width="15%">
49 <img height="45" src="../gatherer_medium.gif" width="45"/>
50 </td>
51 <td align="center" width="*">
52 <a name="{@name}">
53 <xsl:call-template name="processTitle">
54 <xsl:with-param name="sectionNumber" select="$sectionHead"/>
55 <xsl:with-param name="sectionTitle" select="Title"/>
56 </xsl:call-template>
57 </a>
58 </td>
59 <td align="center" width="15%">
60 <img height="45" src="../gatherer_medium.gif" width="45"/>
61 </td>
62 </tr>
63 </table>
64
65 <xsl:apply-templates/>
66 </body>
67 </html>
68
69 <xsl:for-each select="Section">
70 <xsl:call-template name="processSection">
71 <xsl:with-param name="sectionHead" select="concat($sectionHead, '.', position())"/>
72 </xsl:call-template>
73 </xsl:for-each>
74 </xsl:template>
75
76
77 <xsl:template name="processTitle">
78 <xsl:param name="sectionNumber"/>
79 <xsl:param name="sectionTitle"/>
80
81 <font face="Verdana" size="5">
82 <strong>
83 <xsl:value-of select="concat($sectionNumber, ': ', $sectionTitle/Text)"/>
84 </strong>
85 </font>
86 </xsl:template>
87
88 <xsl:template match="span|img|table|b|br|td|tr|u|i">
89 <xsl:copy><xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
90 <xsl:apply-templates/>
91 </xsl:copy>
92 </xsl:template>
93
94 <xsl:template match="AutoText">
95 <xsl:variable name="value"><xsl:choose><xsl:when test="@key"><xsl:value-of select="java:get($diction, @key, @args)"/></xsl:when><xsl:otherwise><xsl:value-of select="@text"/></xsl:otherwise></xsl:choose></xsl:variable>
96 <xsl:choose>
97 <xsl:when test="@type='button'">
98 <b>&lt;<xsl:value-of select="$value"/>&gt;</b>
99 </xsl:when>
100 <xsl:when test="@type='quoted'">
101 <xsl:text>"</xsl:text><xsl:value-of select="$value"/><xsl:text>"</xsl:text>
102 </xsl:when>
103 <xsl:when test="@type='italics'">
104 <i><xsl:value-of select="$value"/></i>
105 </xsl:when>
106 <xsl:when test="@type='plain'">
107 <xsl:value-of select="$value"/>
108 </xsl:when>
109 <xsl:when test="@type='bold'">
110 <b><xsl:value-of select="$value"/></b>
111 </xsl:when>
112 <xsl:otherwise>
113 <xsl:text>"</xsl:text><xsl:value-of select="$value"/><xsl:text>"</xsl:text>
114 </xsl:otherwise>
115 </xsl:choose>
116 </xsl:template>
117
118</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.