Hi Lynn -
You'd probably want something like the following:
<xsl:template match="c01[@level='series']/did/unittitle">
<h4><a name="{$file}b.html#series{position()}"><xsl:apply-templates/></h4>
</xsl:template>
Personally, I find using position() to be a bit complicated and often
hard to debug; I prefer using generate-id() - see [1] for information
and [2] for an example. I also don't really like using <xsl:element>
and <xsl:attribute> as it tends to clutter up the code a bit.
[1] http://www.dpawson.co.uk/xsl/sect2/N4416.html
[2] http://svn.matienzo.org/public/aip/eadxsl/ead.xsl
Incidentally, you'll be able to pick my brain about this in person soon!
Mark
On Tue, May 20, 2008 at 5:27 PM, Lynn Lobash <[log in to unmask]> wrote:
> Does anyone know how to write this anchor tag?
>
>
> <!--This template formats various head (here, series unittitles) elements
> and makes them targets for links from the Table of Contents.-->
>
> <xsl:template match="c01[@level='series']/did/unittitle">
> <h4>
> <a name="?">
>
> <!--The path needs to read ($file)b.html#series + position(), for
> example:filenameb.html#series2, see href established in TOC pasted below.
> -->
>
> <xsl:apply-templates/>
> </a>
> </h4>
> </xsl:template>
>
> <!-- Displays the unittitle and unitdates for a c01 if it is a series (as
> evidenced by the level attribute series)and numbers them
> to form a hyperlink to each. -->
>
>
> <xsl:for-each select="archdesc/dsc/c01[@level='series' or @level='subseries'
> or @level='subgrp' or @level='subcollection']">
> <p style="margin-left:10pt; font-size:10pt">
> <b>
> <a>
> <xsl:attribute name="href">
> <xsl:value-of
> select="$file"/>b.html#series<xsl:number value="position()" format="1"/>
> </xsl:attribute>
> </a>
> </b>
> </p>
> </xsl:for-each>
>
> Thanks you,
> Lynn
>
|