source: greenstone3/trunk/web/sites/localsite/collect/gberg/transform/document-content.xsl@ 17022

Last change on this file since 17022 was 17022, checked in by max, 16 years ago

Move the HTML skeleton from style.xsl to the current XSL file + make it working with both GS2 and GS3 look and feel transformations.

  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <!-- style includes global params interface_name, library_name -->
10 <xsl:include href="style.xsl"/>
11
12 <xsl:output method="html"/>
13
14 <!-- the main page layout template is here -->
15 <xsl:template match="page">
16
17 <xsl:choose>
18 <!-- if we are using hte classic GS2 look and feel use this template otherwise use the default GS3 look and feel template -->
19 <xsl:when test="$interface_name = 'gs2'">
20 <html>
21 <head>
22 <title>
23 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
24 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
25 </title>
26 <xsl:call-template name="globalStyle"/>
27 <xsl:call-template name="pageStyle"/>
28 </head>
29 <body class="bgimage">
30 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
31 <div id="page">
32 <xsl:apply-templates select="pageResponse"/>
33 <xsl:call-template name="greenstoneFooter"/>
34 </div>
35 </body>
36 </html>
37 </xsl:when>
38
39 <xsl:otherwise>
40 <html>
41 <head>
42 <title>
43 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
44 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
45 </title>
46 <xsl:call-template name="globalStyle"/>
47 <xsl:call-template name="pageStyle"/>
48 </head>
49 <body>
50 <div id="globalwrapper">
51 <xsl:call-template name="response" />
52 <xsl:call-template name="greenstoneFooter"/>
53 </div>
54 </body>
55 </html>
56 </xsl:otherwise>
57 </xsl:choose>
58 </xsl:template>
59
60 <xsl:template name="pageTitle">
61 <xsl:value-of select="/page/pageResponse/documentNode/metadataList/metadata[@name='root_Title']"/>
62 </xsl:template>
63
64 <!-- page specific style goes here -->
65 <xsl:template name="pageStyle">
66 <link type="text/css" href="sites/localsite/collect/gberg/transform/darwin.css" rel="stylesheet"/>
67 </xsl:template>
68
69 <xsl:template match="pageResponse">
70 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
71 <xsl:call-template name="standardPageBanner">
72 <xsl:with-param name="collName" select="$collName"/>
73 </xsl:call-template>
74 <xsl:call-template name="navigationBar">
75 <xsl:with-param name="collName" select="$collName"/>
76 </xsl:call-template>
77 <!-- display the document -->
78 <xsl:apply-templates select="documentNode">
79 <xsl:with-param name="collName" select="$collName"/>
80 </xsl:apply-templates>
81 <xsl:call-template name="dividerBar"/>
82 </xsl:template>
83
84 <xsl:template match="documentNode">
85 <xsl:param name="collName"/>
86 <xsl:variable name="docname"><xsl:choose><xsl:when test="contains(@nodeID, '.')"><xsl:value-of select="substring-before(@nodeID, '.')"/></xsl:when><xsl:otherwise><xsl:value-of select="@nodeID"/></xsl:otherwise></xsl:choose></xsl:variable>
87 <h1>
88 <center>
89 <a href="{$library_name}?a=xd&amp;sa=toc&amp;c={$collName}&amp;d={$docname}"><xsl:attribute name="title">Go to the document contents</xsl:attribute><xsl:value-of select="metadataList/metadata[@name='root_Title']"/>&#160;</a>
90 </center>
91 </h1>
92 <xsl:apply-templates select="nodeContent/*"/>
93 </xsl:template>
94
95 <xsl:template match="gutblurb | markupblurb | endmarkupblurb | endgutblurb">
96 </xsl:template>
97
98 <xsl:template match="gutbook | book | frontmatter | bookbody | backmatter | titlepage| htitlepage | toc | dedication | preface | introduction | chapter | part | chapheader | index | appendix | glossary">
99 <xsl:copy>
100 <xsl:copy-of select="@*"/>
101 <xsl:apply-templates/>
102 </xsl:copy>
103 </xsl:template>
104
105<!-- dont seem to be able to apply styles to title tags - cos they are special to html. so we rename title to title1-->
106 <xsl:template match="title">
107 <title1>
108 <xsl:apply-templates/>
109 </title1>
110 </xsl:template>
111
112 <xsl:template match="*">
113 <xsl:copy-of select="."/>
114 </xsl:template>
115
116 <xsl:template match="metadataList">
117 </xsl:template>
118
119</xsl:stylesheet>
120
121
122
123
124
125
126
Note: See TracBrowser for help on using the repository browser.