PlaceName2IndexCSV.xsl

Summary
This is a XSLT script for extracting "placeName" elements from any TEI XML document and creating a table index of placeName values with associated chosen data : title, publisher ...

Add any comments to the 'discussion' tab.

Required Input
This document will take a TEI XML file with TEI root element. An alternative to manage another root element and 2, 3, or more TEI element as children is proposed too.

XPath and XSL version is 1.0 : all processors (xsltProc, Saxon ...) of all environments (XML editor, UNIX-Linux libraries) can process it.

Expected Output
A CSV table containing :
 * a line for each "namePlace", with its value in the first cell
 * associated data found in the TEI source in following cells : publisher, date, main title, DOI id
 * tabs "\t" to separe cells (rows) and "\n" for EndOfLine-NewLine

= Example : = America\tOxford University Press\t2005\tThe Quality of Care Under a Managed-Care Program (...)\t10.1093/geront/45.4.49\n Minneapolis\tOxford University Press\t2005\tThe Quality of Care Under a Managed-Care Program (...)\t10.1093/geront/45.4.496\n MN\tOxford University Press\t2005\tThe Quality of Care Under a Managed-Care Program (...)\t10.1093/geront/45.4.496\n

(...) line model : placeName value\tpublisher value\ttitle[@type='main'] value\tidno[@type='DOI] value\n

Stylesheet
      \t  \t  \t  \t</xsl:text> <xsl:value-of select="normalize-space(//teiHeader/fileDesc/sourceDesc/biblStruct/idno[@type='DOI'])"/> \n</xsl:text> </xsl:for-each> </xsl:template> </xsl:stylesheet>

Alternative : another root element, possibly several "TEI" children
<xsl:template match="//TEI"> <xsl:for-each select=".//placeName"> <xsl:value-of select="."/> \t</xsl:text> <xsl:value-of select="normalize-space(ancestor::TEI/teiHeader/fileDesc/publicationStmt/publisher)"/> \t</xsl:text> \n</xsl:text> </xsl:template> </xsl:stylesheet>