← Prev in month ← Prev in thread

Adding an attribute to the <body> of the TOC file

From
ileana patrolea <>
Date
2006-10-09T09:55:07+00:00
ID
Thread
Adding an attribute to the <body> of the TOC file
Hello,

-------------------
Problem description
-------------------
I'm generating the TOC in a separate file whose name
is generated automatically: bk01-toc.html
I am trying to add a new attribute to the <body>
element of this file.

-------------------
My solution
-------------------
I override the body.attributes template.
In my customized template, I generate the filename of
the current chunk and test if it contains the 'toc'
string.

<xsl:variable name="filename">
            <xsl:apply-templates select="."
mode="chunk-filename"/>
</xsl:variable>
<xsl:message>Testing filename: <xsl:value-of
select="$filename"/></xsl:message>

<xsl:if test="contains($filename,'toc')">
            <xsl:attribute
name="class">test</xsl:attribute>
</xsl:if>

-------------------
Troubles
-------------------
The result returned in the filename variable is
index.html and not bk01-toc.html

-------------------
Questions
-------------------
Why is this happening? What template should I use to
get bk01-toc.html?

Could I use a different approach to solve my problem
(without generating the filename of the current
chunk)?

Thank you,


---------------
mailto: 
tel: +40 724 511 514

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com
← Prev in month ← Prev in thread