Sebastian Rahtz wrote:
> At the risk of reopening old wounds and/or
> cans of worms, can I ask how the cognoscenti here are
> solving the age-old problem of taking a structured TEI
> document littered with <pb/> elements and extracting
> what lies between each <pb/>, using XSL?
>
> Googling around, I find regular correspondence going back
> to at least 1999 (some of it from me...), but
> I lose a sense of what the current state of the art is.
>
> Would people who feel they have this cracked care
> to remind us what their basic approach is? I have
> a vague memory of some incredibly ingenious solutions
> using xsl keys, but that may be fantasy.
Same as the problem of list-detection in OOXML :-)
From memory, something like:
<xsl template match="pb">
<xsl:variable name="anchor" select="generate-id()"/>
<xsl:apply-templates
select="following-sibling::*[not(name()='pb']
[preceding-sibling::pb[1]/generate-id()=$anchor]"
mode="betweenpb"/>
</xsl:template>
That means you need moded templates for all possible element types that
will occur between pbs, and their apply-templateses must also invoke
that mode; and it won't work for pb in mixed content unless you add
something to deal with text nodes. I think. I need more wine.
///Peter
|