source: greenstone3/trunk/web/ui/skins/oran/xsl/collectDocument2.xsl@ 16601

Last change on this file since 16601 was 16447, checked in by davidb, 16 years ago

More careful declaration of XSLT header information for produces XML, not HTML output. This is needed for the JAVA code that then takes some transformed code, parses it back in to a DOM (needs to be XML) and then does some final adjustments. When output was HTML, empty elements such as <script ../> could loose their closing />.

File size: 5.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<xsl:stylesheet version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:gslib="http://www.greenstone.org/skinning"
6 xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="xalan">
7
8<xsl:import href="./util.xsl"/>
9
10<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="xalan">
11
12<xsl:import href="./util.xsl"/>
13
14<xsl:output method="html"/>
15
16<xsl:template match="/">
17 <html>
18 <head>
19 <title>
20 <xsl:call-template name="metadataItem">
21 <xsl:with-param name="name">siteName</xsl:with-param>
22 </xsl:call-template>
23 /
24 <xsl:call-template name="metadataItem">
25 <xsl:with-param name="name">collectionName</xsl:with-param>
26 </xsl:call-template>
27 </title>
28
29 <xsl:copy-of select="$js"/>
30 </head>
31 <body>
32
33 <xsl:if test="$document_currentSection/@nodeType = 'root'">
34 <xsl:attribute name="onload">showContents()</xsl:attribute>
35 </xsl:if>
36
37 <div id="container">
38
39 <div id="header">
40 <div class="title_minor">
41
42
43
44 <a href="{$library}?a=p&amp;sa=home">
45 <xsl:call-template name="metadataItem">
46 <xsl:with-param name="name">siteName</xsl:with-param>
47 </xsl:call-template>
48 </a>
49 /
50 </div>
51 <div class="title_major">
52 <xsl:call-template name="metadataItem">
53 <xsl:with-param name="name">collectionName</xsl:with-param>
54 </xsl:call-template>
55 </div>
56
57 <div id="tablist" class="linklist">
58 <xsl:call-template name="service_list" />
59 </div>
60
61 </div>
62
63 <div id="content" class="noSidebar">
64
65 <br/>
66
67 <xsl:if test="$document_coverImage_exists='true'">
68 <div class="coverImage">
69 <img src="{$document_coverImage_url}"> </img>
70 </div>
71 </xsl:if>
72
73 <h1>
74 <xsl:value-of select="$document_title"/>
75 </h1>
76
77 <div id="subServiceList" class="linklist">
78 <ul>
79 <li> <a href="" target="_blank">view entire document</a></li>
80 <li> <a href="" target="_blank">open in new window</a></li>
81 </ul>
82 </div>
83
84 <xsl:choose>
85 <xsl:when test="$document_type='simple'">
86 <div class="documentBody">
87 <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_content" />
88 </div>
89 </xsl:when>
90
91 <xsl:when test="$document_type='hierarchy' and $document_is_expanded != 'true'">
92 <a id="contentsLink" onclick="showContents()">contents</a>
93
94 <div id="contents">
95 <xsl:call-template name="list_document_content" />
96 </div>
97
98 <br/><br/>
99
100 <div class="documentBody">
101
102 <xsl:choose>
103 <xsl:when test="$document_ancestorSections!=''">
104 <p class="ancestorSections">
105 <xsl:for-each select="$document_ancestorSections_titles">
106 <xsl:value-of select="."/> /
107 </xsl:for-each>
108 </p>
109
110 <h2 class="subsectionHeader"> <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_title"/> </h2>
111
112 </xsl:when>
113 <xsl:otherwise>
114 <xsl:if test="$document_currentSection/@nodeType != 'root'">
115 <h2> <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_title"/> </h2>
116 </xsl:if>
117 </xsl:otherwise>
118 </xsl:choose>
119
120 <xsl:call-template name="section_navigation" />
121
122 <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_content" />
123
124 <xsl:call-template name="section_navigation" />
125 </div>
126 </xsl:when>
127
128
129
130 <xsl:when test="$document_type='hierarchy' and $document_is_expanded">
131
132 <xsl:for-each select="$document_allSections">
133 <xsl:variable name="pos" select="position()"/>
134 <xsl:variable name="depth">
135 <xsl:call-template name="document_section_depth">
136 <xsl:with-param name="index" select="$pos" />
137 </xsl:call-template>
138 </xsl:variable>
139
140 <xsl:element name="h{$depth + 1}">
141 <xsl:call-template name="document_section_title">
142 <xsl:with-param name="index" select="$pos" />
143 </xsl:call-template>
144 </xsl:element>
145
146 <xsl:call-template name="document_section_content">
147 <xsl:with-param name="index" select="$pos" />
148 </xsl:call-template>
149 </xsl:for-each>
150
151 </xsl:when>
152
153 </xsl:choose>
154 </div>
155
156 <div id="footer" >
157 <xsl:call-template name="uiItem">
158 <xsl:with-param name="name">collectionFooter</xsl:with-param>
159 </xsl:call-template>
160 </div>
161 </div>
162
163 </body>
164 </html>
165</xsl:template>
166
167<xsl:template name="section_navigation">
168 <xsl:if test="$document_previousSection!='' or $document_nextSection!=''">
169 <div class="sectionNav">
170 <xsl:if test="$document_previousSection!=''">
171 <a class="prevSection" href="{$document_previousSection_url}" title="{$document_previousSection_title}"> &lt; Previous Section</a>
172 </xsl:if>
173 <xsl:if test="$document_nextSection!=''">
174 <a class="nextSection" href="{$document_nextSection_url}" title="{$document_nextSection_title}">Next Section &gt;</a>
175 </xsl:if>
176 </div>
177 </xsl:if>
178</xsl:template>
179
180
181</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.