From TEIWiki

Jump to: navigation, search



This is a stylesheet from the Croatiae auctores Latini TEI XML collection. For publishing under PhiloLogic, the TEI XML should conform to PhiloLogic specifications; this stylesheet reformats a prosopography list for easier referencing, searching and retrieving by PhiloLogic.

Required input

TEI XML file with a prosopography (see TEI P5 Guidelines 13.3 Biographical and Prosopographical Data).

Expected output

Valid TEI XML file conforming to PhiloLogic specification (with headings containing a standard Croatian variant of persons' names).

Known restrictions

Point (5) below not implemented yet.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:tei=""
    xmlns:xsl="" version="2.0">
    <!-- title: TEI prosopography to PhiloLogic divs -->
    <!-- author: Neven Jovanović, Croatiae auctores Latini -->
    <!-- description: (1) removes the general listPerson element -->
    <!-- description: (2) wraps each person in a separate listPerson -->
    <!-- description: (3a) add a pb so PhiloLogic can reference it -->
    <!-- description: (3) adds div/head to each listPerson -->
    <!-- description: (4) uses the persName[1] text for head text -->
    <!-- description: [(5) hopefully links each listPerson with next/prev mechanism] -->
    <!-- filename: prosop2div.xsl -->
    <!-- modified: 2011-02-12 -->
    <!-- required input: tei xml file with a prosopography (see TEI P5 Guidelines 13.3 Biographical and Prosopographical Data) -->
    <!-- expected output: tei xml file easier to retrieve in PhiloLogic (with headings) -->
    <!-- known restrictions: (5) left for later -->
    <!-- prosop2div.xsl -->

    <!-- copy all -->
    <xsl:template match="@*|node()">
            <xsl:apply-templates select="@*|node()"/>
    <!-- (1) delete listPerson -->
    <xsl:template match="//tei:listPerson">
    <!-- (2) wrap up each person separately in a listPerson element -->
    <xsl:template match="//tei:person">
        <!-- (3a) add a pb so PhiloLogic can reference it -->
        <xsl:element name="pb" namespace="">
            <xsl:attribute name="n">
        <xsl:element name="div" namespace="">
            <xsl:attribute name="type">
                <!-- @type = persona -->
            <!-- add an @xml:id -->
            <xsl:attribute name="xml:id">
                <!-- ids begin with p -->
                <!-- Here we generate an identifier
                    "if you call generate-id() more than once in one run with the same 
                    node as an argument, the processor generates the same ID value each 
                    time for that node." DuCharme, XML Quickly, p. 244-245. -->
                <xsl:value-of select="generate-id(.)"/>
            <!-- (3) divs have heads, with (4) value of first persName text node -->
            <xsl:element name="head" namespace="">
                <xsl:value-of select="tei:persName[1]/text()"/>
            <xsl:element name="listPerson" namespace=""><xsl:text>
            <xsl:apply-templates select="@*|node()"/>

Personal tools