1 Aug 2011 08:29
Re: <pb/> promotion (was Has anybody tried converting Oxygen track changes to tei:add|del?)
Laurent Romary <laurent.romary <at> INRIA.FR>
2011-08-01 06:29:38 GMT
2011-08-01 06:29:38 GMT
It just happens that we had to deal with a similar problem of chunking a document in pages to visualize each page one by one in a frame and did this with Solenne Coutagne (student from Ecole des CHartes) by means of two variables that are propagated at each processing step. I have somehow simplified the stylesheet below by just outlining the entry template and providing a simple application for text nodes, "normal" element (p) and empty ones (lb).
<xsl:template match="/">
<xsl:for-each select="//tei:pb">
<xsl:apply-templates select="//tei:body">
<xsl:with-param name="anfang" select="."/>
<xsl:with-param name="ende" select="following::tei:pb[1]"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="text()">
<xsl:param name="anfang"/>
<xsl:param name="ende"/>
<xsl:if test="not(following::tei:pb[ <at> n=$anfang/ <at> n]) and not(preceding::tei:pb[ <at> n=$ende/ <at> n])">
<xsl:value-of select="."/>
</xsl:if>
</xsl:template>
<xsl:template match="tei:p">
<xsl:param name="anfang"/>
<xsl:param name="ende"/>
<xsl:if test="not(following::tei:pb[ <at> n=$anfang/ <at> n]) and not(preceding::tei:pb[ <at> n=$ende/ <at> n])">
<p>
<xsl:apply-templates>
<xsl:with-param name="anfang" select="$anfang"/>
<xsl:with-param name="ende" select="$ende"/>
</xsl:apply-templates>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="tei:lb">
<xsl:param name="anfang"/>
<xsl:param name="ende"/>
<xsl:if test="not(following::tei:pb[ <at> n=$anfang/ <at> n]) and not(preceding::tei:pb[ <at> n=$ende/ <at> n])">
<br/>
</xsl:if>
</xsl:template>
<xsl:for-each select="//tei:pb">
<xsl:apply-templates select="//tei:body">
<xsl:with-param name="anfang" select="."/>
<xsl:with-param name="ende" select="following::tei:pb[1]"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="text()">
<xsl:param name="anfang"/>
<xsl:param name="ende"/>
<xsl:if test="not(following::tei:pb[ <at> n=$anfang/ <at> n]) and not(preceding::tei:pb[ <at> n=$ende/ <at> n])">
<xsl:value-of select="."/>
</xsl:if>
</xsl:template>
<xsl:template match="tei:p">
<xsl:param name="anfang"/>
<xsl:param name="ende"/>
<xsl:if test="not(following::tei:pb[ <at> n=$anfang/ <at> n]) and not(preceding::tei:pb[ <at> n=$ende/ <at> n])">
<p>
<xsl:apply-templates>
<xsl:with-param name="anfang" select="$anfang"/>
<xsl:with-param name="ende" select="$ende"/>
</xsl:apply-templates>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="tei:lb">
<xsl:param name="anfang"/>
<xsl:param name="ende"/>
<xsl:if test="not(following::tei:pb[ <at> n=$anfang/ <at> n]) and not(preceding::tei:pb[ <at> n=$ende/ <at> n])">
<br/>
</xsl:if>
</xsl:template>
Le 31 juil. 2011 à 05:05, Hayim Lapin a écrit :
I seem to have stepped into a mess. Thanks to those of you who responded. And may I say that this is an amazing group!HLHayim LapinRobert H. Smith Professor of Jewish Studiesand Professor of HistoryDirector, Joseph and Rebecca Meyerhoff Center for Jewish Studies.From: Sebastian Rahtz <sebastian.rahtz <at> OUCS.OX.AC.UK>
Reply-To: Sebastian Rahtz <sebastian.rahtz <at> OUCS.OX.AC.UK>
Date: Sat, 30 Jul 2011 17:20:39 -0400
To: "TEI-L <at> listserv.brown.edu" <TEI-L <at> listserv.brown.edu>
Subject: Re: <pb/> promotion (was Has anybody tried converting Oxygen track changes to tei:add|del?)
Trouble is, that means special-casing div. The para split is surely ok?
Sent from my HTC
----- Reply message -----
From: "Lou Burnard" <lou.burnard <at> retired.ox.ac.uk>
Date: Sat, Jul 30, 2011 16:08
Subject: <pb/> promotion (was Has anybody tried converting Oxygen track changes to tei:add|del?)
To: "Sebastian Rahtz" <sebastian.rahtz <at> oucs.ox.ac.uk>
Cc: "TEI-L <at> listserv.brown.edu" <TEI-L <at> listserv.brown.edu>
On 30/07/11 15:49, Sebastian Rahtz wrote:
> 1. This may not not be what you actually want to get out
> 2. All hell may break loose later when you end up with many copies of the same element (see the repeated
> <div> in the example below)
>
> Whether the use of <at> prev is right, I am wondering with myself.
I would say probably not: it only makes sense in the presence of an
additional attribute <at> part="yes" so that you can distinguish these <div
type="stave">s (which don't actually contain a complete stave) from
those which do.
I am wondering whether it wouldn't be better to introduce some other
intermediate element (a seg would do) to wrap these fragmentary divs.
RSS Feed