Re: [xsl] Linenumbering & word index

Subject: Re: [xsl] Linenumbering & word index
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 6 Aug 2004 18:06:52 +0100
Oh I meant to say:

> Applies the original mode a match for divs only 
> to head and lg/l (modes...yes, must use modes more.)
> > <xsl:template mode="a" match="div">
> > <div poem="{position()}">
> > <xsl:apply-templates mode="a" select="head"/>
> > <xsl:apply-templates mode="a" select="lg/l"/>
> > </div>
> > </xsl:template>
> > 

getting position() right in the template for l

  <xsl:template mode="a" match="l">
  <l n="{position()}">

is the reason for having two apply-templates.
if you went

<xsl:apply-templates mode="a" select="head|lg/l"/>

youe would select the same nodes in the same order, and apply the same
templates but your line counts would include the head lines as well as
the l lines as position{} would reflect the position in the node set
selected by head|lg/l rather than that selected by lg/l

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread