Source of word2html_paragraph.xsl

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
  xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core"
  xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
  xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
  xmlns:o="urn:schemas-microsoft-com:office:office"
  exclude-result-prefixes="w sl aml wx o">
 
<xsl:output method="html" encoding="windows-1250"
  doctype-public="-//W3C//DTD HTML 4.01//EN"
  doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
 
<xsl:template match="w:body">
  <html>
    <head>
      <xsl:if test="//o:DocumentProperties/o:Title">
        <title><xsl:value-of select="//o:DocumentProperties/o:Title" /></title>
      </xsl:if>
    </head>
    <body>
      <xsl:apply-templates />
    </body>
  </html>
</xsl:template>	
 
<xsl:template match="w:p[ancestor::w:body]">
  <xsl:variable name="paraStyle" select="w:pPr/w:pStyle/@w:val" />
  <xsl:variable name="outLvl" select="//w:style[@w:type = 'paragraph' and @w:styleId=$paraStyle]/w:pPr/w:outlineLvl/@w:val" />
  <xsl:variable name="elName">
    <xsl:choose>
      <xsl:when test="$outLvl">h<xsl:value-of select="$outLvl + 1" /></xsl:when>
      <xsl:otherwise>p</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:element name="{$elName}">
    <xsl:choose> 
      <xsl:when test="$elName != 'p'" />
      <xsl:when test="not($paraStyle)" />
      <xsl:when test="$paraStyle = 'normal' or $paraStyle = 'BodyText'" />
      <xsl:otherwise>
        <xsl:attribute name="class"><xsl:value-of select="$paraStyle" /></xsl:attribute>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:apply-templates />
  </xsl:element>
</xsl:template>
 
<xsl:template match="w:t/text()"><xsl:value-of select="." /></xsl:template>
 
<xsl:template match="text()" />
 
</xsl:stylesheet>