<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
         xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
         xmlns:dc='http://purl.org/dc/elements/1.1/'
	 xmlns:dli="http://njlegallib.rutgers.edu/ns/1.0"
         xmlns="http://www.w3.org/1999/xhtml">

<!-- 
      Kevin Reiss kreiss@kinoy.rutgers.edu  appinfo.xsl
      Availabe under the GNU Public License, see file gpl.txt 
-->

<!-- appinfo.xsl contains application specific templates
     pertaining to the document's meta-information, header,
     and footer.
-->

<!-- a meta template for the root element of any document should be implemented.
     In this case the metafiles are in RDF/XML syntax so the template matches,
     element rdf:RDF.
-->

<xsl:template match="rdf:RDF" mode="header">
  <!-- this template will include application
       specific meta tags that come from a file that conforms to
       the basic dublin core RDF/XML format. 

       This only works if a well-formed metafile in 
       RDF XML syntax has been passed by name  
       via the command line with the paramter name
       "metafile".
    -->
  <xsl:apply-templates select="rdf:Description" mode="metainfo"/>
</xsl:template>
<!-- this template grabs rdf:about attribute value from
     the rdf:Description element
-->
<xsl:template match="rdf:Description" mode="metainfo">
  <!-- now process the Dublin core properties.
       This is somewhat clunky.
    -->
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" lang="en"/>
  <title><xsl:value-of select="dc:title"/></title>
  <link rel="schema" href="http://purl.org/dc/elements/1.1/" />
  <!-- select all nodes with the namespace-prefix dc from Dublin Core -->
   <xsl:apply-templates select="dc:*"/>
   <xsl:apply-templates select="dli:*"/>
   <meta name="docID" content="{@dli:docID}"/>
   <meta name="collID" content="{@dli:collID}"/>
</xsl:template>


<xsl:template match="dc:*">
  <!-- local-name will output the appropriate section-->
  <xsl:if test="string-length(.) != 0">
    <meta name="{local-name()}" content="{normalize-space(.)}" />
  </xsl:if>
</xsl:template>

<xsl:template match="dli:*">
  <!-- handles digital library system elements -->
  <xsl:if test="string-length(.) != 0">
    <meta name="{local-name()}" content="{normalize-space(.)}" />
  </xsl:if>
</xsl:template>


<!-- template to give document a title in the output -->
<xsl:template match="rdf:RDF" mode="doctitle">
  <xsl:param select="rdf:Description/dc:title" name="title"/>
  <!-- display the navigation header if desired-->
  <xsl:if test="$displayheader">
  <xsl:call-template name="header">
    <xsl:with-param name="title">
      <xsl:value-of select="$title"/>
    </xsl:with-param>
  </xsl:call-template>
  </xsl:if>
  <h1><xsl:value-of select="normalize-space($title)"/></h1> 
</xsl:template>

<!-- give document a top-level header -->
<xsl:template name="header">
<xsl:param name="title"/>
<div align="left"> 
    <table width="630" border="0" cellpadding="0" cellspacing="0"> 
      <tr align="left">    
	<td>
	<a href="http://mydomain.edu/myhomepage/index.html">Home</a> &gt; <a href="http://mydomain.edu/myhomepage/papers/index.html">Papers</a> &gt; <b><xsl:value-of select="$title"/></b>
	</td>
      </tr> 
    </table> 
    <img src="line.gif" width="630" alt="Spacer Image"/> 
</div>
</xsl:template>



<!-- document footer -->
<xsl:template name="footer">
 <div class="footer">
  <p>&#169; 2002, My Copyright Info</p>
</div>
</xsl:template>

</xsl:stylesheet>

