List words.xslt

This is a relatively simple example of a stylesheet that will generate a list of words, ostensibly for text analysis. It is not intended to be used unmodified. The values of type= attributes of &lt;div>, for example, should be changed to match your project's. Note that this stylesheet does not handle end-of-line hyphenated words properly. You should run your document through something like Unshy.xslt first. 



      

    <xsl:variable name="no-punctuation" select="translate( ., '“”,.;:?!-–—…&quot;',                           '               ')"/> <xsl:choose> <xsl:when test="$case-fold"> <xsl:value-of select="translate( $no-punctuation,         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',          'abcdefghijklmnopqrstuvwxyz')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$no-punctuation"/> </xsl:otherwise> </xsl:choose> </xsl:template>  </xsl:template>  <xsl:text>&#x20;</xsl:text> <xsl:apply-templates select="*|text"/> </xsl:template> </xsl:stylesheet>