<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:tei="http://www.tei-c.org/ns/1.0">
    <xsl:output indent="yes" method="xml" encoding="UTF-8" media-type="text/xml"/>
    <xsl:template match="/">
        <xsl:processing-instruction name="oxygen">
            RNGSchema="http://segonku.unl.edu/teianalytics/TEIAnalytics.rng" type="xml"
        </xsl:processing-instruction>
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="tei:p">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="tei:p/tei:seg">
        <xsl:apply-templates select=" node()"/>
    </xsl:template>
    <xsl:template match="tei:lb">
        <xsl:copy>
            <xsl:attribute name="n">
                <xsl:value-of select="preceding::tei:pb[1]/@n"/>
                <xsl:text>.</xsl:text>
                <xsl:number level="any" format="01" from="tei:pb" count="tei:lb"/>
            </xsl:attribute>
            <xsl:apply-templates select="@*"/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>
