Subject: Re: [xsl] generating <a href="#section"> menus. Related to <xsl:for-each> and generate-id() From: Tobias Reif <tobiasreif@xxxxxxxxxxxxx> Date: Tue, 14 Jan 2003 15:17:24 +0100 |
:I prefer descriptive ids/anchors: : :Instead of :http://author.handalak.com/xml/about.xml#sect_II :I'd do s.th. like :http://author.handalak.com/xml/about.xml#whatisxmlandxsl
That's what the first revision did. If you open the .xml file source (by appending ?source=1 to the url) you will see that I assigned "id" to each <sect>. I didn't like assigning ids manually,
so I thought there had to be an easier way, and guess what, there was :-).
Yes. I am generating the descriptive IDs from the section titles:
<t:template name="toc" xml:space="preserve"> <div id="tocunit"> <h2> <a id="toc" name="toc"> <acronym title="Table Of Contents">TOC</acronym> (this page): </a> </h2> <ul title="toc" class="inline"> <li class="skipNavigation"> <a href="#main">To Content</a>, </li> <t:for-each select="//sect1" xml:space="default"> <li> <a> <t:attribute name="href"> <t:text>#</t:text> <t:call-template name="clean"> <t:with-param name="input" select="title"/> </t:call-template> </t:attribute> <t:value-of select="title"/> </a> <t:if test="following::sect1"> <t:text>, </t:text> </t:if> </li> <t:text>
</t:text> </t:for-each> </ul> </div> </t:template>
Vim users donate. http://iccf-holland.org/donate.html
Web developers check. http://www.pinkjuice.com/check/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] generating <a href="#sect, Sherzod Ruzmetov | Thread | Re: [xsl] generating <a href="#sect, Tobias Reif |
Re: [xsl] the fo:block thing, Tony Graham | Date | Re: [xsl] the fo:block thing, G. Ken Holman |
Month |