source: main/trunk/greenstone3/web/WEB-INF/classes/config_format.xsl@ 30501

Last change on this file since 30501 was 10042, checked in by kjdon, 19 years ago

resources/java files moved to web/WEB-INF/classes so they are automatically in the classpath

  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 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:xslt="output.xsl"
5 xmlns:java="http://xml.apache.org/xslt/java"
6 xmlns:gsf="http://www.greenstone.org/configformat"
7 extension-element-prefixes="java">
8
9 <xsl:output method="xml"/>
10 <xsl:namespace-alias
11 stylesheet-prefix="xslt" result-prefix="xsl"/>
12
13
14 <xsl:template match="format">
15 <format hello="yes">
16 <xsl:apply-templates/>
17 </format>
18 </xsl:template>
19
20 <xsl:template match="gsf:template">
21 <xslt:template>
22 <xsl:copy-of select="@*"/>
23 <xsl:attribute name="priority">2</xsl:attribute>
24 <xsl:if test=".//gsf:link/@type">
25 <xslt:param name="serviceName">service-name</xslt:param>
26 </xsl:if>
27 <xsl:if test=".//gsf:link">
28 <xslt:param name="collName">coll-name</xslt:param>
29 <xslt:variable name='library' select='ancestor::page/config/library_name'/>
30 </xsl:if>
31 <xsl:apply-templates/>
32 </xslt:template>
33 </xsl:template>
34
35 <xsl:template match="gsf:link">
36 <xsl:choose>
37 <xsl:when test="@type='classifier'">
38 <a><xslt:attribute name='href'><xslt:value-of select='$library'/>?a=b&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if></xslt:attribute>
39 <xsl:apply-templates/>
40 </a>
41 </xsl:when>
42 <xsl:otherwise> <!-- a document link -->
43 <a><xsl:attribute name="href">{$library}?a=d&amp;c={$collName}&amp;d={@nodeID}</xsl:attribute>
44 <xsl:apply-templates/>
45 </a>
46 </xsl:otherwise>
47 </xsl:choose>
48 </xsl:template>
49
50 <xsl:template match="gsf:icon">
51 <xsl:choose>
52 <xsl:when test="@type='classifier'">
53 <img src='interfaces/default/images/bshelf.gif' border='0' width='20' height='16' />
54 </xsl:when>
55 <xsl:otherwise>
56 <xslt:apply-templates select="." mode="displayNodeIcon"/>
57 <!--
58 <img src='interfaces/default/images/book.gif' width='18' height='11' border='0'/>-->
59 </xsl:otherwise>
60 </xsl:choose>
61 </xsl:template>
62
63 <xsl:template match="gsf:metadata">
64 <xslt:value-of><xsl:attribute name="select">metadataList/metadata[@name='<xsl:value-of select="@name"/>']</xsl:attribute></xslt:value-of>
65 </xsl:template>
66
67<!--
68 <xsl:template match="gsf:text">
69TODO
70 </xsl:template>
71-->
72 <xsl:template match="*">
73 <xsl:copy>
74 <xsl:copy-of select="@*"/>
75 <xsl:apply-templates/>
76 </xsl:copy>
77 </xsl:template>
78
79
80<!-- copied from style for now-->
81<!-- Display the appropriate image, depending on the node type -->
82<xsl:template match="documentNode" mode="displayNodeIcon">
83
84 <!-- Root node: book icon (open or closed) -->
85 <xsl:if test="@nodeType='root'">
86 <xsl:choose>
87 <xsl:when test="documentNode">
88 <img border="0" width="28" height="23"
89 src="interfaces/default/images/openbook.gif"
90 alt="Close this book"/>
91 </xsl:when>
92 <xsl:otherwise>
93 <img border="0" width="18" height="11"
94 src="interfaces/default/images/book.gif"
95 alt="Open this document and view contents"/>
96 </xsl:otherwise>
97 </xsl:choose>
98 </xsl:if>
99
100 <!-- Interior node: folder icon (open or closed) -->
101 <xsl:if test="@nodeType='interior'">
102 <xsl:choose>
103 <xsl:when test="documentNode">
104 <img border="0" width="23" height="15"
105 src="interfaces/default/images/openfldr.gif"
106 alt="Close this folder"/>
107 </xsl:when>
108 <xsl:otherwise>
109 <img border="0" width="23" height="15"
110 src="interfaces/default/images/clsdfldr.gif"
111 alt="Open this folder and view contents"/>
112 </xsl:otherwise>
113 </xsl:choose>
114 </xsl:if>
115
116 <!-- Leaf node: page icon -->
117 <xsl:if test="@nodeType='leaf'">
118 <img border="0" width="16" height="21"
119 src="interfaces/default/images/itext.gif"
120 alt="View the document"/>
121 </xsl:if>
122</xsl:template>
123
124</xsl:stylesheet>
125
126
Note: See TracBrowser for help on using the repository browser.