Index: /trunk/gsdl3/interfaces/default/transform/classifier.xsl
===================================================================
--- /trunk/gsdl3/interfaces/default/transform/classifier.xsl	(revision 3435)
+++ /trunk/gsdl3/interfaces/default/transform/classifier.xsl	(revision 3435)
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+xmlns:java="http://xml.apache.org/xslt/java"
+extension-element-prefixes="java">
+
+<xsl:include href="style-tmp.xsl"/>
+
+<xsl:output method="html"/>  
+
+<xsl:template match="page">
+<html>
+<xsl:call-template name="greenstoneHead"/>
+<body xsl:use-attribute-sets="body-style">
+<center>
+<xsl:apply-templates select="response/classifier"/>
+</center>
+<xsl:call-template name="greenstoneFooter"/>
+</body>
+</html>
+</xsl:template>
+
+<!-- recursively process all nodes and resources -->
+
+<xsl:template match="classifier[@type='vertical' and @interleave='true']">
+<xsl:variable name='link' select='@link'/>
+<xsl:value-of select="@name"/>
+<p/>
+<table width='537'><xsl:for-each select='node|resource'>
+<xsl:choose><xsl:when test='name()="node"'><tr valign='top'><xsl:apply-templates select='.' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates><xsl:apply-templates select='.' mode='process-children'><xsl:with-param name='interleave'>true</xsl:with-param></xsl:apply-templates></tr>
+</xsl:when>
+<xsl:otherwise><tr valign='top'><xsl:apply-templates select='.'/></tr>
+</xsl:otherwise></xsl:choose>
+</xsl:for-each>
+</table>
+</xsl:template>
+
+<xsl:template match="classifier[@type='vertical' and @interleave='false']">
+<xsl:variable name='link' select='@link'/>
+<xsl:value-of select="@name"/>
+<p/>
+<!-- process the nodes and resources separately-->
+<table width='537'>
+<xsl:for-each select='node'>
+<tr valign='top'><xsl:apply-templates select='.' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates></tr><tr><td></td><td><xsl:apply-templates select='.' mode='process-children'><xsl:with-param name='interleave' select='false'/></xsl:apply-templates></td></tr></xsl:for-each>
+</table>
+<table width='537'>
+<xsl:for-each select='//resource'>
+<tr valign='top'><xsl:apply-templates select='.'></xsl:apply-templates></tr>
+</xsl:for-each>
+</table>
+</xsl:template>
+
+<xsl:template match="classifier[@type='horizontal' and @interleave='false']">
+<xsl:variable name='link' select='@link'/>
+<xsl:value-of select="@name"/>
+<p/>
+<!-- process the nodes and resources separately-->
+
+<table width='537'><tr valign='top'>
+<xsl:for-each select='node'>
+<xsl:apply-templates select='.' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates>
+</xsl:for-each></tr>
+<tr valign='top'>
+<xsl:for-each select='node'>
+<xsl:apply-templates select='.' mode='process-children'><xsl:with-param name='interleave' select='false'/></xsl:apply-templates></xsl:for-each></tr>
+</table>
+<table width='537'>
+<xsl:for-each select='//resource'>
+<tr valign='top'><xsl:apply-templates select='.'/></tr>
+</xsl:for-each>
+</table>
+</xsl:template>
+
+<xsl:template match="classifier[@type='horizontal' and @interleave='true']">
+<xsl:variable name='link' select='@link'/>
+<xsl:value-of select="@name"/>
+<p/>
+<!-- process the nodes and resources together -->
+
+<table><tr valign='top'>
+<xsl:for-each select='node|resource'>
+<xsl:choose><xsl:when test='name()="node"'><xsl:apply-templates select='.' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates><xsl:apply-templates select='.' mode='process-children'><xsl:with-param name='interleave'>true</xsl:with-param></xsl:apply-templates>
+</xsl:when>
+<xsl:otherwise><xsl:apply-templates select='.'/>
+</xsl:otherwise></xsl:choose>
+</xsl:for-each>
+</tr></table>
+</xsl:template>
+
+<xsl:template match="resource">
+<xsl:variable name='library' select='ancestor::page/config/library_name'/>
+<td><a href="{$library}?a=r&amp;c=mgppdemo&amp;r={@name}">+++</a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
+</xsl:template>
+
+
+<!-- the output for the classifier link and label, may be overwritten -->
+
+<xsl:template match="node" mode="current-node">
+<xsl:param name="link" select="icon"/>
+<xsl:variable name="library" select="ancestor::page/config/library_name"/>
+<xsl:choose><xsl:when test="$link='icon'">
+<td><a href="{$library}?a=b&amp;c=mgppdemo&amp;cl={@name}">***</a></td><td><xsl:value-of select="@name"/></td>
+</xsl:when><xsl:otherwise>
+<td><a href="{$library}?a=b&amp;c=mgppdemo&amp;cl={@name}"><xsl:value-of select="@name"/></a></td>
+</xsl:otherwise></xsl:choose>
+</xsl:template>
+
+<!-- processing for the recursive bit -->
+<!-- if interleave=true, process all child nodes and resources, else just do nodes -->
+
+<xsl:template match="node" mode="process-children">
+<xsl:param name="link" select="icon"/>
+<xsl:param name='interleave'>true</xsl:param>
+<xsl:choose><xsl:when test="$interleave='true'">
+<td><p/>
+<xsl:choose><xsl:when test='@type="vertical"'>
+<table><xsl:for-each select='node|resource'>
+<xsl:choose><xsl:when test='name()="node"'><tr valign='top'><xsl:apply-templates select='.' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates><xsl:apply-templates select='.' mode='process-children'><xsl:with-param name='interleave'>true</xsl:with-param></xsl:apply-templates></tr>
+</xsl:when>
+<xsl:otherwise><tr valign='top'><xsl:apply-templates select='.'/></tr>
+</xsl:otherwise></xsl:choose><!-- name=node -->
+</xsl:for-each></table>
+</xsl:when>
+<xsl:otherwise><!-- type = vertical fails -->
+<table><tr valign='top'><xsl:for-each select='node|resource'>
+<xsl:choose><xsl:when test='name()="node"'><xsl:apply-templates select='.' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates><xsl:apply-templates select='.' mode='process-children'><xsl:with-param name='interleave'>true</xsl:with-param></xsl:apply-templates>
+</xsl:when>
+<xsl:otherwise><xsl:apply-templates select='.'/>
+</xsl:otherwise></xsl:choose> <!-- name=node -->
+</xsl:for-each>
+</tr></table>
+</xsl:otherwise></xsl:choose><!-- end of orientation choice -->
+</td>
+</xsl:when>
+<xsl:otherwise> <!-- interleave = false -->
+<td><p/>
+<xsl:choose><xsl:when test='@type="vertical"'>
+<table><xsl:for-each select='node'><tr><xsl:apply-templates select='.' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates></tr><tr><xsl:apply-templates select='.' mode='process-children'><xsl:with-param name='interleave'>false</xsl:with-param></xsl:apply-templates></tr></xsl:for-each></table>
+</xsl:when>
+<xsl:otherwise>
+<table><tr valign='top'><xsl:apply-templates select='node' mode='current-node'><xsl:with-param name='link' select='$link'/></xsl:apply-templates><xsl:apply-templates select='node' mode='process-children'><xsl:with-param name='interleave'>false</xsl:with-param></xsl:apply-templates></tr></table>
+</xsl:otherwise></xsl:choose> <!-- end of orientation choice -->
+</td>
+</xsl:otherwise>
+</xsl:choose> <!-- end of interleave choice -->
+</xsl:template>
+
+</xsl:stylesheet>
