source: trunk/gsdl3/web/interfaces/default/transform/config_format.xsl@ 4731

Last change on this file since 4731 was 4731, checked in by kjdon, 21 years ago

small change to reflect changes in the base templates

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