Difference between revisions of "Tei2html"

From TEIWiki
Jump to navigation Jump to search
m
m (Reverted edit of Bv3P4i, changed back to last version by James)
Line 1: Line 1:
[http://it.rigour.info/topic/lotus-esprit/ lotus esprit 2.2] [http://down.rigour.info/blog/fiale-per.htm fiale per capelli] [http://gratis.rigour.info/content/view/aspirapolvere-con.htm aspirapolvere con battitappeto] [http://italy.rigour.info/blog/decoder-con.htm decoder con contributo statale] [http://dir.rigour.info/rsmmc-dv/ rs-mmc dv per nokia 6630 512] [http://guest.rigour.info/library/html/posizione/ posizione 69] [http://blog.rigour.info/web/bracciale-topazio/ bracciale topazio argento] [http://gratis.rigour.info/content/view/occidentale-papua.htm occidentale (papua nuova guinea)] [http://dir.rigour.info/cuba-e/ cuba e lavana] [http://uve.rigour.info/blog/tre-gendarmi.htm tre gendarmi a new york] [http://up.rigour.info/description/lib/happy-di.htm happy di clinique] [http://dir.rigour.info/roiate/ roiate] [http://uve.rigour.info/blog/toyota-paseo.htm toyota paseo] [http://it.rigour.info/topic/quiz-patente/ quiz patente] [http://gratis.rigour.info/content/view/viaccess-key.htm viaccess key 20 11 2004] [http://blog.rigour.info/web/live-in/ live in hyde park] [http://web.rigour.info/mediterraneo-colonna/ mediterraneo colonna sonora film] [http://note.rigour.info/content/view/www-bassanodelgrappa.htm www bassanodelgrappa it] [http://online.rigour.info/olympus-fotocamera/ olympus fotocamera digitale 5 0] [http://gratis.rigour.info/content/view/citta-di.htm citta di pisa] [http://content.rigour.info/html/mr-funky/ mr funky] [http://online.rigour.info/uv-lampada/ uv lampada] [http://here.rigour.info/blog/crypt.htm crypt] [http://web.rigour.info/super-ciro/ super ciro] [http://pagina.rigour.info/ver-el/ ver el video de tardes negras] [http://down.rigour.info/blog/deep-purple.htm deep purple child in tima] [http://up.rigour.info/description/lib/sara-maldonado.htm sara maldonado] [http://pagina.rigour.info/world-rally/ world rally championship ii extreme] [http://gratis.rigour.info/content/view/www-msn.htm www msn com] [http://up.rigour.info/description/lib/iovine-patrizia.htm iovine patrizia] [http://here.rigour.info/blog/grace-of.htm grace of my heart] [http://down.rigour.info/blog/foto-di.htm foto di misilmeri] [http://all.rigour.info/www-alessandro/ www alessandro preziosi it] [http://here.rigour.info/blog/testi-delle.htm testi delle canzoni dei 24 grana] [http://load.rigour.info/view/new/bubble-bobbe.htm bubble bobbe 2] [http://here.rigour.info/blog/matriosca.htm matriosca] [http://pagina.rigour.info/chacker/ chacker] [http://speed.rigour.info/vdo-dayton.htm vdo dayton 2604] [http://note.rigour.info/content/view/bachatahits.htm bachatahits] [http://blog.rigour.info/web/citofono/ citofono] [http://uve.rigour.info/blog/titanic-mp.htm titanic mp3 titanic] [http://milano.rigour.info/fronte-dal.htm fronte dal palco live] [http://web.rigour.info/jura/ jura 385] [http://here.rigour.info/blog/classe-a.htm classe a lavastoviglie] [http://gratis.rigour.info/content/view/kapula.htm kapula] [http://blog.rigour.info/web/canon-mm/ canon 50mm 1 8] [http://here.rigour.info/blog/canadiangirl.htm canadiangirl] [http://dir.rigour.info/yala/ yala] [http://milano.rigour.info/cowboy-bebop.htm cowboy bebop. vol. 03] [http://pagina.rigour.info/ultimo-cd/ ultimo cd degli u2] [http://pagina.rigour.info/sandisk-mp/ sandisk mp3] [http://here.rigour.info/blog/buongiorno-napoli.htm buongiorno napoli] [http://speed.rigour.info/alberghi-treviso.htm alberghi treviso] [http://milano.rigour.info/nec-lcd.htm nec lcd 15] [http://up.rigour.info/description/lib/siti-internet.htm siti internet lecco] [http://italy.rigour.info/blog/juliana-big.htm juliana big brother] [http://down.rigour.info/blog/giochi-nuovi.htm giochi nuovi] [http://content.rigour.info/html/immagini-talpa/ immagini talpa con paola perego] [http://paga.rigour.info/cinzia-molena/ cinzia molena nuda] [http://content.rigour.info/html/kokkola/ kokkola] [http://dir.rigour.info/accessori-bambini/ accessori bambini] [http://dir.rigour.info/pioneer-dehmp/ pioneer deh-4700mp] [http://paga.rigour.info/pc-siemens/ pc siemens] [http://blog.rigour.info/web/brazil/ brazil] [http://down.rigour.info/blog/sblocco-z.htm sblocco z1010] [http://dir.rigour.info/bmw/ bmw 525] [http://content.rigour.info/html/screesavers/ screesavers] [http://blog.rigour.info/web/fiat-punto/ fiat punto elx 5p 2000] [http://all.rigour.info/lingeries/ lingeries] [http://guest.rigour.info/library/html/outcast/ outcast] [http://note.rigour.info/content/view/marley-dvd.htm marley dvd] [http://here.rigour.info/blog/impresa-lombardia.htm impresa lombardia] [http://paga.rigour.info/giovane/ giovane] [http://online.rigour.info/stafania-orlando/ stafania orlando] [http://dir.rigour.info/fz/ fz 61 1] [http://down.rigour.info/blog/suker-per.htm suker per sempre] [http://gratis.rigour.info/content/view/yugioh-dawn.htm yu-gi-oh dawn of destiny] [http://online.rigour.info/viridiana/ viridiana] [http://it.rigour.info/topic/router-adsl/ router adsl 125 mbps] [http://up.rigour.info/description/lib/austrodaimler.htm austro-daimler] [http://pagina.rigour.info/hotel-economici/ hotel economici madrid] [http://milano.rigour.info/interattivo.htm interattivo] [http://content.rigour.info/html/foto-scooter/ foto scooter preparati] [http://pagina.rigour.info/izoard-col/ izoard, col d-] [http://it.rigour.info/topic/costo-rottame/ costo rottame] [http://gratis.rigour.info/content/view/karan-goran.htm karan goran] [http://dir.rigour.info/figaro-le/ figaro, le-] [http://guest.rigour.info/library/html/calcolo-isee/ calcolo isee] [http://note.rigour.info/content/view/scanner-lg.htm scanner lg 600] [http://note.rigour.info/content/view/panasonic-dp.htm panasonic dp 2310] [http://dir.rigour.info/www-taglia/ www taglia42 it] [http://here.rigour.info/blog/video-karaoke.htm video karaoke italia gratis] [http://down.rigour.info/blog/trani-a.htm trani a gogo] [http://web.rigour.info/morte-lorna/ morte lorna] [http://it.rigour.info/topic/svije/ svije] [http://load.rigour.info/view/new/archie-shepp.htm archie shepp. quartet. part 2] [http://uve.rigour.info/blog/il-mare.htm il mare derba] [http://up.rigour.info/description/lib/thief-.htm thief 3 - trailer] [http://content.rigour.info/html/la-cantante/ la cantante dei black eyes peas] [http://content.rigour.info/html/www-scienze/ www scienze uniba it] [http://dir.rigour.info/cranberries-zombi/ cranberries zombi] [http://web.rigour.info/fscaller/ fscaller] [http://paga.rigour.info/pulangkanlah/ pulangkanlah] [http://gratis.rigour.info/content/view/betsabe.htm betsabe] [http://paga.rigour.info/tinto-rosse/ tinto rosse] [http://pagina.rigour.info/ilocos-norte/ ilocos norte] [http://speed.rigour.info/case-rustiche.htm case rustiche] [http://load.rigour.info/view/new/bormio-albergo.htm bormio albergo] [http://load.rigour.info/view/new/zoom-.htm zoom 90 calcio] [http://load.rigour.info/view/new/finanziamenti-fondo.htm finanziamenti fondo perduto] [http://guest.rigour.info/library/html/test-sul/ test sul futuro] [http://here.rigour.info/blog/contenido-de.htm contenido de la letra de cambio] [http://pagina.rigour.info/foredil-brescia/ foredil brescia] [http://guest.rigour.info/library/html/harrods-it/ harrods it com] [http://pagina.rigour.info/estados-unidos/ estados unidos] [http://speed.rigour.info/vigliaccheria.htm vigliaccheria] [http://gratis.rigour.info/content/view/toolbox.htm toolbox] [http://it.rigour.info/topic/starray/ starray] [http://dir.rigour.info/karma-malo/ karma malo malo pomalo] [http://it.rigour.info/topic/tastiera-touch/ tastiera touch] [http://blog.rigour.info/web/comprar-vivienda/ comprar vivienda] [http://up.rigour.info/description/lib/testo-della.htm testo della canzone universal prayer] [http://paga.rigour.info/escape-from/ escape from monkey island] [http://gratis.rigour.info/content/view/nortek-lettore.htm nortek lettore di mp3 1gb] [http://content.rigour.info/html/mirage-paps/ mirage paps] [http://here.rigour.info/blog/due-nuovi.htm due nuovi filmati per gran turismo 4] [http://note.rigour.info/content/view/opel-astra.htm opel astra 1 7] [http://uve.rigour.info/blog/bilancia-philips.htm bilancia philips] [http://it.rigour.info/topic/edizione-gold/ edizione gold per rise of nations] [http://note.rigour.info/content/view/eugene-amstrong.htm eugene amstrong video] [http://blog.rigour.info/web/albergo-forli/ albergo forli] [http://down.rigour.info/blog/olio-essenziale.htm olio essenziale di limone] [http://guest.rigour.info/library/html/apoteosi/ apoteosi] [http://uve.rigour.info/blog/t-shirt.htm t shirt maniche lunghe donna] [http://content.rigour.info/html/frisinga/ frisinga] [http://note.rigour.info/content/view/stampante-hp.htm stampante hp 450] [http://load.rigour.info/view/new/tendina-giordani.htm tendina giordani] [http://here.rigour.info/blog/ddr-notebook.htm ddr notebook] [http://web.rigour.info/tenda-/ tenda 3 persone] [http://speed.rigour.info/robbie-wilson.htm robbie wilson] [http://web.rigour.info/kosheen-catch/ kosheen catch you] [http://paga.rigour.info/www-fica/ www fica] [http://gratis.rigour.info/content/view/etq.htm etq] [http://guest.rigour.info/library/html/heiltsuk/ heiltsuk] [http://note.rigour.info/content/view/mutandina-usata.htm mutandina usata] [http://dir.rigour.info/fuori-strada/ fuori strada subaru] [http://online.rigour.info/dirty-dancing/ dirty dancing] [http://down.rigour.info/blog/xu.htm xu 440] [http://it.rigour.info/topic/lettore-dvd/ lettore dvd home theatre] [http://note.rigour.info/content/view/asus-pp.htm asus p4p800 x] [http://gratis.rigour.info/content/view/router-adsl.htm router adsl zyxel] [http://guest.rigour.info/library/html/piccolo-uomo/ piccolo uomo] [http://pagina.rigour.info/natalia-millan/ natalia millan] [http://paga.rigour.info/halmahera/ halmahera] [http://italy.rigour.info/blog/pagina-iniziale.htm pagina iniziale] [http://note.rigour.info/content/view/my-immortal.htm my immortal nuova versione] [http://online.rigour.info/orchidea/ orchidea 71] [http://up.rigour.info/description/lib/franz-listz.htm franz listz] [http://here.rigour.info/blog/miroslav.htm miroslav] [http://online.rigour.info/altavilla/ altavilla] [http://milano.rigour.info/philips.htm philips 7630] [http://it.rigour.info/topic/logitech-desktop/ logitech desktop ex 100] [http://milano.rigour.info/musoduro.htm musoduro] [http://down.rigour.info/blog/robbie-willims.htm robbie willims] [http://here.rigour.info/blog/mare-di.htm mare di piu] [http://gratis.rigour.info/content/view/caldaie-ricambi.htm caldaie ricambi napoli] [http://guest.rigour.info/library/html/southwest-com/ southwest com] [http://blog.rigour.info/web/ona-je/ ona je poput djeteta 100 na jednoga] [http://blog.rigour.info/web/jeep-nuova/ jeep nuova grand cherokee 2005] [http://dir.rigour.info/herramientas-de/ herramientas de negociacion] [http://gratis.rigour.info/content/view/clubprive-milano.htm clubprive milano] [http://up.rigour.info/description/lib/mpe-mm.htm mp-e 65mm] [http://all.rigour.info/asphalt-urban/ asphalt urban gt2] [http://web.rigour.info/pro-evolution/ pro evolution soccer 4 scontato a fine mese] [http://here.rigour.info/blog/www-enature.htm www enature net] [http://content.rigour.info/html/meteo-biella/ meteo biella] [http://milano.rigour.info/regina-elisabetta.htm regina elisabetta] [http://paga.rigour.info/sia-di/ sia di fornaci] [http://dir.rigour.info/immagini-o/ immagini o foto del kamasutra] [http://content.rigour.info/html/corvo-torvo/ corvo torvo] [http://content.rigour.info/html/fiat-scudo/ fiat scudo jtd] [http://speed.rigour.info/abito-firmato.htm abito firmato] [http://content.rigour.info/html/nx/ nx6110 740] [http://content.rigour.info/html/sen-kombi/ sen kombi] [http://uve.rigour.info/blog/canzone-california.htm canzone california dei phantom planet] [http://here.rigour.info/blog/hamsterball.htm hamsterball] [http://web.rigour.info/www-un/ www un posto al sole com] [http://speed.rigour.info/sunshine-baby.htm sunshine baby] [http://content.rigour.info/html/la-spada/ la spada del deserto] [http://speed.rigour.info/www-verona.htm www verona volley it] [http://blog.rigour.info/web/viava-la/ viava la pappa] [http://online.rigour.info/periyar/ periyar] [http://online.rigour.info/funkytown/ funkytown] [http://note.rigour.info/content/view/kreuk.htm kreuk] [http://pagina.rigour.info/radeon/ radeon 9800 256] [http://paga.rigour.info/mini-gb/ mini 40gb] [http://uve.rigour.info/blog/pentax-mx.htm pentax mx] [http://guest.rigour.info/library/html/lorena-berno/ lorena berno] [http://web.rigour.info/foto-stereo/ foto stereo] [http://it.rigour.info/topic/samsung-vcr/ samsung vcr] <pre><nowiki>
+
<pre><nowiki>
 
<?xml version='1.0'?>
 
<?xml version='1.0'?>
 
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
 
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
Line 339: Line 339:
 
</xsl:when>
 
</xsl:when>
 
<xsl:when test='./@rend = "fiction"'>
 
<xsl:when test='./@rend = "fiction"'>
<p class='fiction'><xsl:text></nowiki></pre>
+
<p class='fiction'><xsl:text>&#160;&#160;&#160;&#160;</xsl:text><xsl:apply-templates /></p>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "pre"'>
 +
<pre><xsl:apply-templates /></pre>
 +
</xsl:when>
 +
<xsl:otherwise>
 +
<p><xsl:apply-templates /></p>
 +
</xsl:otherwise>
 +
</xsl:choose>
 +
</xsl:template>
 +
 
 +
<!-- quote (quote) -->
 +
<xsl:template match="quote">
 +
<blockquote><xsl:apply-templates /></blockquote>
 +
</xsl:template>
 +
 
 +
<!-- line group (lg) -->
 +
<xsl:template match="lg">
 +
<p><xsl:apply-templates /></p>
 +
</xsl:template>
 +
 
 +
<!-- line (l) -->
 +
<xsl:template match="l">
 +
<xsl:if test='@rend = "indent"'>
 +
<xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
 +
</xsl:if>
 +
<xsl:apply-templates /><br />
 +
</xsl:template>
 +
 
 +
<!-- hypertext reference (xref) -->
 +
<xsl:template match="xref">
 +
<a><xsl:attribute name='href'><xsl:value-of select='./@url' /></xsl:attribute><xsl:apply-templates /></a>
 +
</xsl:template>
 +
 
 +
<!-- table (table) -->
 +
<xsl:template match="table">
 +
<xsl:choose>
 +
<xsl:when test='./@rend = "left"'>
 +
<table border='0' align='left'><xsl:apply-templates /></table>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "right"'>
 +
<table border='0' align='right'><xsl:apply-templates /></table>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "center"'>
 +
<table border='0' align='center'><xsl:apply-templates /></table>
 +
</xsl:when>
 +
<xsl:otherwise>
 +
<table border='0'><xsl:apply-templates /></table>
 +
</xsl:otherwise>
 +
</xsl:choose>
 +
</xsl:template>
 +
 
 +
<!-- table row (row) -->
 +
<xsl:template match="row">
 +
<xsl:choose>
 +
<xsl:when test='./@rend = "left"'>
 +
<tr align='left' valign='top'><xsl:apply-templates /></tr>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "right"'>
 +
<tr align='right' valign='top'><xsl:apply-templates /></tr>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "center"'>
 +
<tr align='center' valign='top'><xsl:apply-templates /></tr>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "justify"'>
 +
<tr align='justify' valign='top'><xsl:apply-templates /></tr>
 +
</xsl:when>
 +
<xsl:otherwise>
 +
<tr valign='top'><xsl:apply-templates /></tr>
 +
</xsl:otherwise>
 +
</xsl:choose>
 +
</xsl:template>
 +
 
 +
 
 +
<!-- table row (cell) -->
 +
<xsl:template match="cell">
 +
<xsl:choose>
 +
<xsl:when test='./@rend = "left"'>
 +
<td align='left'><xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates /></td>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "right"'>
 +
<td align='right'><xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates /></td>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "center"'>
 +
<td align='center'><xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates /></td>
 +
</xsl:when>
 +
<xsl:when test='./@rend = "justify"'>
 +
<td align='justify'><xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates /></td>
 +
</xsl:when>
 +
<xsl:otherwise>
 +
<td><xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates /></td>
 +
</xsl:otherwise>
 +
</xsl:choose>
 +
</xsl:template>
 +
 
 +
 
 +
<!-- lists -->
 +
<!-- cool XPath expressions and logic by bodard gabriel <gabriel.bodard@kcl.ac.uk> -->
 +
<xsl:template match="list[@type='gloss']">
 +
  <dl><xsl:apply-templates/></dl>
 +
</xsl:template>
 +
 +
<xsl:template match="list[@type='ordered']">
 +
  <ol><xsl:apply-templates/></ol>
 +
</xsl:template>
 +
 +
<xsl:template match="list[@type='bulleted']">
 +
  <ul><xsl:apply-templates/></ul>
 +
</xsl:template>
 +
 +
<xsl:template match="list[@type='simple']">
 +
  <ul style='list-style-type: none'><xsl:apply-templates/></ul>
 +
</xsl:template>
 +
 +
<xsl:template match="label[parent::list[@type='gloss']]">
 +
  <dt><xsl:apply-templates/></dt>
 +
</xsl:template>
 +
 +
<xsl:template match="item[parent::list[@type='gloss']]">
 +
  <dd><xsl:apply-templates/></dd>
 +
</xsl:template>
 +
 +
<xsl:template match="item[parent::list[@type='bulleted']]">
 +
  <li><xsl:apply-templates/></li>
 +
</xsl:template>
 +
 +
<xsl:template match="item[parent::list[@type='simple']]">
 +
  <li><xsl:apply-templates/></li>
 +
</xsl:template>
 +
 +
<xsl:template match="item[parent::list[@type='ordered']]">
 +
  <li><xsl:apply-templates/></li>
 +
</xsl:template>
 +
 
 +
 
 +
<!-- do nothing templates -->
 +
 
 +
<!-- teiheader (do nothing) -->
 +
<xsl:template match="teiHeader" />
 +
 +
<!-- teiheader (do nothing) -->
 +
<xsl:template match="front/titlePage" />
 +
 +
<!-- head (head) -->
 +
<xsl:template match="head" />
 +
 
 +
</xsl:stylesheet>
 +
</nowiki></pre>
 +
[[Category:XSLT]]

Revision as of 10:41, 22 August 2007

<nowiki>
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

<!--

  tei2html.xsl
  
  This XSLT file will convert a TEI 4 file to .html file intended for
  the Alex Catalogue of Electronic Texts. It is pretty much a plain o'
  HTML file that could be printed for viewed by the most basic of
  browsers. The output is suppose to about as Plain Jane as possible.

  This file is distributed under the GNU Public License.
  
  Eric Lease Morgan (eric_morgan@infomotions.com)
  May 5, 2005

-->

	<xsl:output 
	  method='xml'
	  omit-xml-declaration='no'
	  indent='yes'
	  doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' 
	  doctype-system='http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' />
  	
	<xsl:template match='TEI.2'>
		<html>
		
			<head>
	
				<!-- title tag -->
				<title> 
					<xsl:for-each select="teiHeader/fileDesc/titleStmt/title">
						<xsl:if test='./@type = "main"'>
							<xsl:value-of select='.' />
						</xsl:if>
					</xsl:for-each>
					<xsl:text> / </xsl:text>
					<xsl:for-each select="teiHeader/fileDesc/titleStmt/author/name">
						<xsl:if test='./@type = "main"'>
							<xsl:value-of select='.' />
						</xsl:if>
					</xsl:for-each>
					<xsl:text> </xsl:text>
					<xsl:value-of select="teiHeader/fileDesc/titleStmt/author/dateRange"/>
				</title> 
	
				<xsl:comment>Dublin Core elements</xsl:comment>

				<!-- title -->
				<xsl:for-each select="teiHeader/fileDesc/titleStmt/title">
					<xsl:if test='./@type = "main"'>
						<meta>
							<xsl:attribute name='name'>title</xsl:attribute>
							<xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute>
						</meta>
					</xsl:if>
				</xsl:for-each>
	
				<!-- creator -->
				<meta>
					<xsl:attribute name='name'>creator</xsl:attribute>
					<xsl:for-each select="teiHeader/fileDesc/titleStmt/author/name">
						<xsl:if test='./@type = "main"'>
							<xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute>
						</xsl:if>
					</xsl:for-each>
				</meta>
	
				<!-- subjects -->
				<xsl:for-each select='teiHeader/profileDesc/textClass/keywords/list/item'>
					<meta>
						<xsl:attribute name='name'>subject</xsl:attribute>
						<xsl:attribute name='content'><xsl:value-of select='normalize-space(.)' /></xsl:attribute>
					</meta>
				 </xsl:for-each>
        
				<!-- description -->
				<xsl:for-each select="/TEI.2/teiHeader/fileDesc/notesStmt/note">
					<xsl:if test='./@type = "description"'>
						<meta>
							<xsl:attribute name='name'>description</xsl:attribute>
							<xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute>
						</meta>
					</xsl:if>
				</xsl:for-each>					
	
				<!-- publisher -->
				<meta>
					<xsl:attribute name='name'>publisher</xsl:attribute>
					<xsl:attribute name='content'><xsl:value-of select='normalize-space(teiHeader/fileDesc/publicationStmt/publisher)' /></xsl:attribute>
				</meta>
	
				<!-- contributor -->
				<xsl:for-each select="teiHeader/fileDesc/titleStmt/respStmt/name">
					<xsl:if test='./@type = "contributor"'>
						<meta>
							<xsl:attribute name='name'>contributor</xsl:attribute>
							<xsl:attribute name='content'><xsl:value-of select='.' /></xsl:attribute>
						</meta>
					</xsl:if>
				</xsl:for-each>					

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

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

					</xsl:attribute>
				</meta>
	
				<!-- date -->
				<meta>
					<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>
				</meta>
	
				<style type='text/css'>h1, h2, h3, h4, h5, h6 { font-family : sans-serif; }
				p.fiction { margin-top: 0em; margin-bottom: 0em;}</style>
				
			</head>
			
			<body style='margin:5%;'>
				
				<!-- "title" page -->
				<h1 style='text-align:center'><xsl:value-of select='teiHeader/fileDesc/titleStmt/title' /></h1>
				<p style='text-align:center'><xsl:value-of select='/TEI.2/text/front/titlePage/byline' /></p>
				<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' /></p>
				<hr />

				<!-- cool table of contents -->
				<xsl:if test='/TEI.2/text/body/div1'>
					<h2>Table of contents</h2>
					<p>
					<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><br />
						</xsl:if>
					</xsl:for-each>
					</p>
				</xsl:if>
				
				<!-- do the heavy lifting -->
				<xsl:apply-templates/>
						
			</body>
			
		</html>
		
	</xsl:template>
	
	<!-- division #0 (div) -->
	<xsl:template match="div">
		<xsl:choose>
			<xsl:when test='./@type = "colophon"'>
				<hr />
				<h2><xsl:value-of select='./head' /></h2> 
			</xsl:when>
		</xsl:choose>
		<xsl:apply-templates />
	</xsl:template>

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

	<!-- division #2 (div2) -->
	<xsl:template match="div2">
		<h3><xsl:value-of select='./@type' /><xsl:text> </xsl:text><xsl:value-of select='./@n' /><xsl:text>. </xsl:text><xsl:value-of select='./head' /></h3>
		<xsl:apply-templates />
	</xsl:template>

	<!-- division #3 (div3) -->
	<xsl:template match="div3">
		<h4><xsl:value-of select='./@type' /><xsl:text> </xsl:text><xsl:value-of select='./@n' /><xsl:text>. </xsl:text><xsl:value-of select='./head' /></h4>
		<xsl:apply-templates />
	</xsl:template>

	<!-- division #4 (div4) -->
	<xsl:template match="div4">
		<h5><xsl:value-of select='./@type' /><xsl:text> </xsl:text><xsl:value-of select='./@n' /><xsl:text>. </xsl:text><xsl:value-of select='./head' /></h5>
		<xsl:apply-templates />
	</xsl:template>

	<!-- division #5 (div5) -->
	<xsl:template match="div5">
		<h6><xsl:value-of select='./@type' /><xsl:text> </xsl:text><xsl:value-of select='./@n' /><xsl:text>. </xsl:text><xsl:value-of select='./head' /></h6>
		<xsl:apply-templates />
	</xsl:template>

	<!-- images (figure) -->
	<xsl:template match="figure">
	<img>
	<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>
	</img>
	<xsl:apply-templates/>
	</xsl:template>

	<!-- figure description (figDesc) -->
	<xsl:template match='figDesc'>
	<span class='caption'><xsl:apply-templates/></span>
	</xsl:template>
	
	<!-- line break (lb) -->
	<xsl:template match='lb'>
	<br /><xsl:apply-templates />
	</xsl:template>

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

</xsl:when> <xsl:otherwise>

<xsl:apply-templates />

</xsl:otherwise> </xsl:choose> </xsl:template>

<xsl:template match="quote">

<xsl:apply-templates />

</xsl:template>

<xsl:template match="lg">

<xsl:apply-templates />

</xsl:template>

<xsl:template match="l"> <xsl:if test='@rend = "indent"'> <xsl:text>    </xsl:text> </xsl:if> <xsl:apply-templates />
</xsl:template>

<xsl:template match="xref"> <a><xsl:attribute name='href'><xsl:value-of select='./@url' /></xsl:attribute><xsl:apply-templates /></a> </xsl:template>

<xsl:template match="table"> <xsl:choose> <xsl:when test='./@rend = "left"'>

<xsl:apply-templates />

</xsl:when> <xsl:when test='./@rend = "right"'>

<xsl:apply-templates />

</xsl:when> <xsl:when test='./@rend = "center"'>

<xsl:apply-templates />

</xsl:when> <xsl:otherwise>

<xsl:apply-templates />

</xsl:otherwise> </xsl:choose> </xsl:template>

<xsl:template match="row"> <xsl:choose> <xsl:when test='./@rend = "left"'>

<xsl:apply-templates /> </xsl:when> <xsl:when test='./@rend = "right"'> <xsl:apply-templates /> </xsl:when> <xsl:when test='./@rend = "center"'> <xsl:apply-templates /> </xsl:when> <xsl:when test='./@rend = "justify"'> <xsl:apply-templates /> </xsl:when> <xsl:otherwise> <xsl:apply-templates /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="cell"> <xsl:choose> <xsl:when test='./@rend = "left"'> <xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates />

</xsl:when> <xsl:when test='./@rend = "right"'>

<xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates />

</xsl:when> <xsl:when test='./@rend = "center"'>

<xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates />

</xsl:when> <xsl:when test='./@rend = "justify"'>

<xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates />

</xsl:when> <xsl:otherwise>

<xsl:attribute name='colspan'><xsl:value-of select='@cols' /></xsl:attribute><xsl:apply-templates />

</xsl:otherwise> </xsl:choose> </xsl:template>


<xsl:template match="list[@type='gloss']">

<xsl:apply-templates/>

</xsl:template>

<xsl:template match="list[@type='ordered']">

    <xsl:apply-templates/>

</xsl:template>

<xsl:template match="list[@type='bulleted']">

    <xsl:apply-templates/>

</xsl:template>

<xsl:template match="list[@type='simple']">

    <xsl:apply-templates/>

</xsl:template>

<xsl:template match="label[parent::list[@type='gloss']]">

<xsl:apply-templates/>

</xsl:template> <xsl:template match="item[parent::list[@type='gloss']]">

<xsl:apply-templates/>

</xsl:template> <xsl:template match="item[parent::list[@type='bulleted']]">

  • <xsl:apply-templates/>
  • </xsl:template> <xsl:template match="item[parent::list[@type='simple']]">

  • <xsl:apply-templates/>
  • </xsl:template> <xsl:template match="item[parent::list[@type='ordered']]">

  • <xsl:apply-templates/>
  • </xsl:template> <xsl:template match="teiHeader" /> <xsl:template match="front/titlePage" /> <xsl:template match="head" /> </xsl:stylesheet> </nowiki>