jcowey / P3

This is now a collection point for the Papyrological Publishing Platform (P3). To be found here are the files which are used to produce articles in the journal Pylon.
2 stars 3 forks source link

pylonFormatting.xsl #27

Closed samosafuz closed 2 months ago

samosafuz commented 2 months ago

This file is a first attempt at automating via XSLT various basic changes that are necessary following the conversion to XML of a .docx accepted for publication in Pylon. Comments within the file describe these changes, but I list them here, as well, for the sake of reference.

    <xsl:template match="div[@subtype='Pylon']//lb">    
        <xsl:copy>
            <xsl:attribute name="xml:id">
                <xsl:value-of select="concat(ancestor::div[@subtype='Pylon'][1]/@xml:id, string-join(for $div in ancestor::div return $div/@n), 'ln', @n)"/>
            </xsl:attribute>
            <xsl:apply-templates select="@*[not(name() = 'xml:id')] | node()"/>
        </xsl:copy>
    </xsl:template>