Tei2shtml

 

        /        </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> <link rel="stylesheet" href="/alex2/etc/musings.css" type="text/css" media="screen" /> <link rel="stylesheet" href="/alex2/etc/musings-print.css" type="text/css" media="print" /> <xsl:comment>#include virtual="/alex2/etc/navigation.inc"</xsl:comment> <xsl:comment>#include virtual="/alex2/etc/contents.inc"</xsl:comment> View/download as: <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/>.txt</xsl:text></xsl:attribute>plain text</a>, <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/>.html</xsl:text></xsl:attribute>plain HTML</a>, <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/>.shtml</xsl:text></xsl:attribute>"smart" HTML</a>, <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/><xsl:text>.prc</xsl:text></xsl:attribute>PalmPilot DOC and eReader</a>, <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/><xsl:text>.html</xsl:text></xsl:attribute>Rocket eBook</a>, <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/><xsl:text>.pkg</xsl:text></xsl:attribute>Newton Paperback</a>, <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/><xsl:text>.pdf</xsl:text></xsl:attribute>PDF</a>, <a><xsl:attribute name='href'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/idno)'/><xsl:text>.xml</xsl:text></xsl:attribute>TEI/XML</a>

<xsl:value-of select='teiHeader/fileDesc/titleStmt/title' /> <xsl:value-of select='/TEI.2/text/front/titlePage/byline' /> <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:for-each select="/TEI.2/text/*/div1"> <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:text><xsl:value-of select='./@n' /><xsl:text>. </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>