<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<!--
tei2newton.xsl
This is the beginnings of a XSLT file to convert TEI 4 documents into
Newton Paperback files. ("Remember Apple Newtons?"). The resulting
file will need to be "compiled" with a program called PBBookMaker in
order to actually create a file the Newton can read.
This file is distributed under the GNU Public License.
Eric Lease Morgan (eric_morgan@infomotions.com)
May 5, 2005
-->
<xsl:output method='text' />
<xsl:template match='TEI.2'>
<xsl:text>
</xsl:text>###<xsl:value-of select='teiHeader/fileDesc/titleStmt/title' /><xsl:text>
</xsl:text><xsl:value-of select='teiHeader/fileDesc/titleStmt/title' /><xsl:text>

</xsl:text>Originally written/published in <xsl:value-of select='teiHeader/profileDesc/creation/date' /> by <xsl:value-of select='teiHeader/fileDesc/titleStmt/author' /><xsl:text>
</xsl:text><!-- cool table of contents --><xsl:text>
</xsl:text><xsl:if test='/TEI.2/text/body/div1'><xsl:text>
</xsl:text>Table of contents<xsl:text>
</xsl:text><xsl:for-each select="/TEI.2/text/body/div1"><xsl:text>
</xsl:text><xsl:value-of select='./head' /><xsl:text>
</xsl:text></xsl:for-each><xsl:text>
</xsl:text></xsl:if><xsl:text>
</xsl:text><!-- do the heavy lifting --><xsl:text>
</xsl:text><xsl:apply-templates/> <xsl:text>
</xsl:text><xsl:text>
</xsl:text>###Colophon<xsl:text>

</xsl:text>Colophon<xsl:text>

</xsl:text>This file was originally marked up using the Text Encoding Initiative XML markup language for use in the Infomotions Alex Catalog of Electronic Texts (http://infomotions.com/alex/) by <xsl:value-of select='teiHeader/revisionDesc/change/respStmt/name'/> on <xsl:value-of select='teiHeader/fileDesc/publicationStmt/date'/> for the purpose of freely sharing, distributing, and making available works of great literature. This file is placed in the public domain. It's Infomotions unique identifier is <xsl:value-of select='teiHeader/fileDesc/publicationStmt/idno'/>. <xsl:value-of select='teiHeader/fileDesc/sourceDesc/p'/>.<xsl:text>

</xsl:text>"Give back to the 'Net."<xsl:text>
</xsl:text></xsl:template>
<!-- division #1 (div1) -->
<xsl:template match="div1"><xsl:text>
</xsl:text>###<xsl:value-of select='./head'/>
<xsl:text>
</xsl:text><xsl:text>
</xsl:text><xsl:value-of select='./head'/>
<xsl:text>
</xsl:text>
<xsl:apply-templates />
</xsl:template>
<!-- paragraph (p) -->
<xsl:template match="p">
<xsl:text>
</xsl:text>
<xsl:apply-templates />
<xsl:text>
</xsl:text>
</xsl:template>
<!-- do nothing templates -->
<!-- teiheader (do nothing) -->
<xsl:template match="teiHeader" />
<!-- head (head) -->
<xsl:template match="head" />
</xsl:stylesheet>