home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8"?>
-
- <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:html="http://www.w3.org/TR/html4/loose.dtd"
- exclude-result-prefixes="html"
- version="1.0">
-
- <xsl:output method="html" encoding="UTF-8"/>
-
- <xsl:template match="firstparagraph">
- <xsl:apply-templates select="body | class"/>
- </xsl:template>
-
-
- <!-- don't need to output title since title is in title tag -->
- <xsl:template match="title">
- </xsl:template>
-
- <xsl:template match="titlsub">
- </xsl:template>
-
- <xsl:template match="tabbrev|chemsym">
- </xsl:template>
-
- <xsl:template match="firstart">
- </xsl:template>
-
-
- <xsl:template match="asset">
- </xsl:template>
-
- <xsl:template match="class">
- <xsl:variable name="parseBody">
- <xsl:apply-templates select="label"/> <xsl:apply-templates select="commonname"/>
- <xsl:apply-templates select="desc"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($parseBody) > 300">
- <xsl:call-template name="gist">
- <xsl:with-param name="gistbody" select="$parseBody"/>
- </xsl:call-template>...
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$parseBody"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="body">
- <xsl:variable name="parseBody">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($parseBody) > 300">
- <xsl:call-template name="gist">
- <xsl:with-param name="gistbody" select="$parseBody"/>
- </xsl:call-template>...
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$parseBody"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="gist">
- <xsl:param name="charposition" select="300"/>
- <xsl:param name="gistbody"/>
- <xsl:choose>
- <xsl:when test="substring($gistbody,$charposition,1) = ' '">
- <xsl:value-of select="substring($gistbody,1,$charposition)" disable-output-escaping="no"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="gist">
- <xsl:with-param name="charposition" select="$charposition - 1"/>
- <xsl:with-param name="gistbody" select="$gistbody"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
-