View File | Revision Log | Show Annotations | Download File | View Changeset
/hippo/hippo-cms-site-sample/transformers/page.xsl
Revision: 414
Committed: Fri Dec 9 13:45:01 2005 UTC (14 years, 11 months ago) by nvankampenhout
Content type: application/xml
File size: 2800 byte(s)
Error occurred while calculating annotation data.
Log Message:
initial checkin

File Contents

# Content
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet
3 version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:d="DAV:"
6 xmlns:h="http://hippo.nl/cms/1.0"
7 xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
8 xmlns:dasl="http://cocoon.apache.org/webdav/dasl/1.0"
9 exclude-result-prefixes="i18n h d dasl"
10 >
11
12 <!-- Import XSL library for document content -->
13 <xsl:import href="library.xsl"/>
14
15 <!-- Parameters passed from sitemap -->
16 <xsl:param name="selectedDocument"/>
17 <xsl:param name="previewOrLive">live</xsl:param>
18
19 <!-- Page template -->
20 <xsl:template match="/">
21 <html>
22 <head>
23 <title>
24 <i18n:text>page.title</i18n:text>
25 </title>
26 <link type="text/css" href="layout.css" rel="stylesheet"/>
27 </head>
28 <body>
29
30 <div id="top">
31 <i18n:text>page.title</i18n:text>
32 <xsl:if test="$previewOrLive = 'preview'">
33 <xsl:text> (</xsl:text>
34 <xsl:value-of select="$previewOrLive"/>
35 <xsl:text>)</xsl:text>
36 </xsl:if>
37 </div>
38
39 <div id="container">
40
41 <div id="navigation">
42 <xsl:apply-templates select="/root/documents"></xsl:apply-templates>
43 </div>
44
45 <div id="content">
46 <xsl:choose>
47 <xsl:when test="/root/document">
48 <xsl:apply-templates select="/root/document"/>
49 </xsl:when>
50 <xsl:otherwise>
51 <i18n:text>page.content.nodocumentselected</i18n:text>
52 </xsl:otherwise>
53 </xsl:choose>
54 </div>
55
56 </div>
57
58 </body>
59 </html>
60 </xsl:template>
61
62 <!-- Navigation menu -->
63 <xsl:template match="documents">
64 <div id="logoContainer">
65 <a href="index.html">
66 <img src="logo.png" width="92" height="66" alt="page.navigation.logo" i18n:attr="alt" border="0"/>
67 </a>
68 </div>
69 <div class="NavigationTitle">
70 <i18n:text>page.navigation.title</i18n:text>
71 </div>
72 <xsl:apply-templates select="dasl:query-result/dasl:resource">
73 <xsl:sort select="h:index" data-type="number" order="ascending"/>
74 <xsl:sort select="h:caption" data-type="text" order="ascending"/>
75 </xsl:apply-templates>
76 </xsl:template>
77
78 <!-- Navigation menu item -->
79 <xsl:template match="dasl:resource">
80 <div>
81 <xsl:attribute name="class">
82 <xsl:text>NavigationLink</xsl:text>
83 <xsl:if test="d:displayname = $selectedDocument"> Selected</xsl:if>
84 </xsl:attribute>
85 <a href="{substring-before(d:displayname, '.xml')}.html">
86 <xsl:value-of select="h:caption"/>
87 </a>
88 </div>
89 </xsl:template>
90
91 </xsl:stylesheet>