Re: [xsl] Linenumbering & word index

Subject: Re: [xsl] Linenumbering & word index
From: James Cummings <James.Cummings@xxxxxxxxxxxxxx>
Date: Sat, 7 Aug 2004 20:26:38 +0100 (BST)
On Fri, 6 Aug 2004, David Carlisle wrote:

Ok, so I had a thought.  I thought "What if I now want a copy of 
the original line for each instance of the appearance of a word."
(more of a concordance than a word-list).


>   <xsl:for-each select="key('w',.)">
>   <xsl:text> </xsl:text>
>   <xsl:value-of select="../../@poem"/>:<xsl:value-of select="../@n"/>

So here I added (with html spans for CSS):
<xsl:apply-templates select="../word"/>

And a template match elsewhere which forces there to be 
a space after each word <xsl:text> </xsl:text>.

But of course, this just re-consitutes the punctuation-missing 
lowercased text() from the temporary tree.  

The original lines have things like
<l>This is a wor<supplied>d</supplied>.</l>
which are rendered as: wor[d] in the HTML version 
of the poems.  

So I guess my question is how (and how difficult is it) 
to have a copy of the original line to put in at this point?

3 Basic methods occur to me 
  1) put a copy-of the original line into the temporary tree 
     which I can then pull out at this point.
  2) do something complicated with modes and keys/generatedids 
     to go process a copy of that line at this point so that 
     all the underlying templates get matched as well.
  3) locate a copy of the original based on the poemnumber 
     and linenumber
  4) do something silly like open up another copy of the 
     document() and get just that line.

But seeing as this is XSLT2, I'm not necessarily sure which 
is best.  Really the reconstructed temporary tree is probably 
a good enough solution.   But I thought I should ask in case 
it wasn't *too* difficult.

-James

---
Dr James Cummings, Oxford Text Archive, University of Oxford
James dot Cummings at oucs dot ox dot ac dot uk 
CALL FOR PAPERS: Digital Medievalism (Kalamazoo) and 
Early Drama (Leeds) see http://users.ox.ac.uk/~jamesc/cfp.html

Current Thread