Tei2html

 

        /        </xsl:text> <xsl:value-of select="teiHeader/fileDesc/titleStmt/author/dateRange"/> <xsl:comment>Dublin Core elements</xsl:comment>

 <xsl:if test='./@type = "main"'> <xsl:attribute name='name'>title</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute> </xsl:if> </xsl:for-each> <xsl:attribute name='name'>creator</xsl:attribute>  <xsl:if test='./@type = "main"'> <xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute> </xsl:if> </xsl:for-each>  <xsl:attribute name='name'>subject</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='normalize-space(.)' /></xsl:attribute> </xsl:for-each>  <xsl:if test='./@type = "description"'> <xsl:attribute name='name'>description</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute> </xsl:if> </xsl:for-each> <xsl:attribute name='name'>publisher</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/publisher)' /></xsl:attribute>  <xsl:if test='./@type = "contributor"'> <xsl:attribute name='name'>contributor</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute> </xsl:if> </xsl:for-each>

<xsl:attribute name='name'>date</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='normalize-space(teiHeader/profileDesc/creation/date)' /></xsl:attribute> <xsl:attribute name='name'>type</xsl:attribute> <xsl:attribute name='content'>Text</xsl:attribute> <xsl:attribute name='name'>format</xsl:attribute> <xsl:attribute name='content'>text/html</xsl:attribute> <xsl:attribute name='name'>identifier</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)' /></xsl:attribute> <xsl:attribute name='name'>source</xsl:attribute> <xsl:attribute name='content'> <xsl:value-of select='normalize-space(.)'/></xsl:for-each> </xsl:attribute> <xsl:attribute name='name'>language</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='normalize-space(teiHeader/profileDesc/langUsage/language)' /></xsl:attribute> <xsl:attribute name='name'>relation</xsl:attribute> <xsl:attribute name='content'>http://infomotions.com/alex/</xsl:attribute> <xsl:attribute name='name'>rights</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/availability/p)' /></xsl:attribute> <xsl:comment>Alex Catalogue metadata elements</xsl:comment>

<xsl:attribute name='name'>sort_creator</xsl:attribute>  <xsl:if test='./@type = "sort"'> <xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute> </xsl:if> </xsl:for-each> <xsl:attribute name='name'>sort_title</xsl:attribute>  <xsl:if test='./@type = "sort"'> <xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute> </xsl:if> </xsl:for-each> <xsl:attribute name='name'>brief</xsl:attribute> <xsl:attribute name='content'>  <xsl:if test='./@type = "main"'> <xsl:value-of select='.' /> </xsl:if> </xsl:for-each>  / </xsl:text>  <xsl:if test='./@type = "main"'> <xsl:value-of select='.' /> </xsl:if> </xsl:for-each>  </xsl:text> <xsl:value-of select="teiHeader/fileDesc/titleStmt/author/dateRange"/>

</xsl:attribute> <xsl:attribute name='name'>sort_date</xsl:attribute> <xsl:attribute name='content'><xsl:value-of select='normalize-space(teiHeader/profileDesc/creation/date/@value)' /></xsl:attribute> <style type='text/css'>h1, h2, h3, h4, h5, h6 { font-family : sans-serif; } p.fiction { margin-top: 0em; margin-bottom: 0em;} <body style='margin:5%;'> <h1 style='text-align:center'><xsl:value-of select='teiHeader/fileDesc/titleStmt/title' /> <p style='text-align:center'><xsl:value-of select='/TEI.2/text/front/titlePage/byline' /> <p style='text-align:center'><xsl:value-of select='/TEI.2/text/front/titlePage/docImprint' /><xsl:value-of select='/TEI.2/text/front/titlePage/imprimatur' />

<xsl:if test='/TEI.2/text/body/div1'> Table of contents  <xsl:if test='./@type != "colophon"'> <a><xsl:attribute name="href">#<xsl:value-of select='./@id' /></xsl:attribute><xsl:value-of select='./head' /></a>

</xsl:if> </xsl:for-each> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="div"> <xsl:choose> <xsl:when test='./@type = "colophon"'> <xsl:value-of select='./head' /> </xsl:when> </xsl:choose> <xsl:apply-templates /> </xsl:template>

<xsl:template match="div1"> <xsl:choose> <xsl:when test='./@type = "colophon"'> </xsl:when> </xsl:choose> <a><xsl:attribute name="name"><xsl:value-of select='./@id' /></xsl:attribute><xsl:value-of select='./head' /></a> <xsl:apply-templates /> </xsl:template>

<xsl:template match="div2"> <xsl:value-of select='./@type' /> </xsl:text><xsl:value-of select='./@n' />. </xsl:text><xsl:value-of select='./head' /> <xsl:apply-templates /> </xsl:template>

<xsl:template match="div3"> <xsl:value-of select='./@type' /><xsl:text> </xsl:text><xsl:value-of select='./@n' /><xsl:text>. </xsl:text><xsl:value-of select='./head' /> <xsl:apply-templates /> </xsl:template>

<xsl:template match="div4"> <xsl:value-of select='./@type' /><xsl:text> </xsl:text><xsl:value-of select='./@n' /><xsl:text>. </xsl:text><xsl:value-of select='./head' /> <xsl:apply-templates /> </xsl:template>

<xsl:template match="div5"> <xsl:value-of select='./@type' /><xsl:text> </xsl:text><xsl:value-of select='./@n' /><xsl:text>. </xsl:text><xsl:value-of select='./head' /> <xsl:apply-templates /> </xsl:template>

<xsl:template match="figure"> <xsl:attribute name='src'><xsl:value-of select='./@url' /></xsl:attribute> <xsl:choose> <xsl:when test='./figDesc'> <xsl:attribute name='alt'><xsl:value-of select='normalize-space(./figDesc)' /></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name='alt'><xsl:value-of select='./@url' /></xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test='./@rend = "top"'> <xsl:attribute name='align'><xsl:value-of select='./@rend' /></xsl:attribute> </xsl:when> <xsl:when test='./@rend = "middle"'> <xsl:attribute name='align'><xsl:value-of select='./@rend' /></xsl:attribute> </xsl:when> <xsl:when test='./@rend = "bottom"'> <xsl:attribute name='align'><xsl:value-of select='./@rend' /></xsl:attribute> </xsl:when> <xsl:when test='./@rend = "left"'> <xsl:attribute name='align'><xsl:value-of select='./@rend' /></xsl:attribute> </xsl:when> <xsl:when test='./@rend = "right"'> <xsl:attribute name='align'><xsl:value-of select='./@rend' /></xsl:attribute> </xsl:when> <xsl:otherwise /> </xsl:choose> <xsl:apply-templates/> </xsl:template>

<xsl:template match='figDesc'> <xsl:apply-templates/> </xsl:template> <xsl:template match='lb'> <xsl:apply-templates /> </xsl:template>

<xsl:template match="p"> <xsl:choose> <xsl:when test='./@rend = "right"'> <p style='text-align:right'><xsl:apply-templates /> </xsl:when> <xsl:when test='./@rend = "center"'> <p style='text-align:center'><xsl:apply-templates /> </xsl:when> <xsl:when test='./@rend = "fiction"'> <p class='fiction'><xsl:text>