XSL navigation

tench

Registered
Hi. I am writing an xsl file for a TEI lite xml doc. The xml doc contains chapters of a book, something along the lines of:
Code:
<body>
<divGen type="toc">
<div1 type="chapter" n="1">
<head>Blah-blah</head>
<p> text... text... text. </p>
<p> text... text... text. </p>
...
</div1>
...
</body>

Now, I would like the XSL to create a navigation panel for this book by pointing to chapter titles as anchor points. SO: I know what I need, but I don't know how to do it:

a) how can I mark the original XML doc so that <head>Blah-blah</head> is also automatically marked as <a href="blah blah"></a>?

b) how can I insert the actual value-of select="head" between the quotation marks in <a href>:

Code:
<xsl:template match="div1" mode="toc">
<li><a href="#"> <xsl:value-of select="head"/></a></li>
</xsl:template>

c) is there an even simpler way to do this by doing something with divGen?

Many thanks in advance,
Tench
 
figured it out... didn't have to do with the content of the head tag, but rather with the attribute of <div1>. and the secret is, of course, that you can insert attributes into literal result elements by placing it within {}
 
Back
Top