Hi All,
I'm working on my first style sheet here.
I'm having a problem splitting up a large XML file into lots of nice
friendly small HTML files. I want to split the large EAD/XML finding aid
into the small HTML files based on the first letter of the Title of each of
the items.
I can successfully get the individual html files to be created, and even
put some stuff into them, but I can not figure our how to get the items,
based on the starting letter, to move on over into the HTML from the XML.
My problem seems to be with <xsl:if
test="starts-with(//did/unittitle/title,'$lett')">
How do I get the "starts-with" to check to see what that title is starting
with?
<xsl:template match="/">
<xsl:call-template name="out"/>
</xsl:template>
<xsl:template name="showbox">
Show That Box Here!
</xsl:template>
<xsl:template name="page">
<html>
<head><title>The Letter <xsl:value-of select="." /></title></head>
<body>
<xsl:for-each select=".">
<xsl:variable name="lett" select="."/>
<xsl:value-of select="$lett"/>
<xsl:if test="starts-with(//did/unittitle/title,'$lett')">
<xsl:call-template name="showbox"/>
</xsl:if>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template name="out">
<html>
<head><title>Title</title></head>
<body>
<p>Line 1<br/>Line 2</p>
<xsl:for-each select="/ead/archdesc/other/letter">
<xsl:variable name="file"><xsl:value-of select="." /></xsl:variable>
<xt:document method="html" href="{$file}.html">
<xsl:call-template name="page"/>
</xt:document>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
------------------------------------------
Blake Carver
Web Librarian
The Ohio State University Libraries
[log in to unmask]
247-7424
|