Hi Bob,
thanks for your advice. I did it a little bit different, I put all the stuff to
the
my variablelist REQ/REC customization, also the admonition stuff.
<xsl:template match="varlistentry/term">
<span class="{parent::varlistentry/@role}term">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:choose>
<xsl:when test="parent::varlistentry/@role = 'REQ'">
<img class="{parent::varlistentry/@role}img"
src="{parent::varlistentry/@role}.png" alt="Requirement"/>
<xsl:text>REQ-</xsl:text>
<xsl:variable name="reqnumber">
<xsl:number count="[EMAIL PROTECTED] = 'REQ']" level="any"/>
</xsl:variable>
<xsl:number value="$reqnumber+-1" format="01"/>
</xsl:when>
<xsl:when test="parent::varlistentry/@role = 'REC'">
<img class="{parent::varlistentry/@role}img"
src="{parent::varlistentry/@role}.png" alt="Recommendation"/>
<xsl:text>REC-</xsl:text>
<xsl:variable name="recnumber">
<xsl:number count="[EMAIL PROTECTED] = 'REC']" level="any"/>
</xsl:variable>
<xsl:number value="$recnumber+-1" format="01"/>
</xsl:when>
With css, it looks now very nice.
The nasty thing is, that I define a lot things agian (duplicate) in my
FO-customization layer,
cause I did not understand how to recall other templates...
Halm
Bob Stayton wrote:
> For reasons unknown to me, only the variablelist element gets a class
> attribute in HTML output, not varlistentry. Perhaps that is a
> deficiency that should be corrected in the stylesheets. In any case,
> this additional customization will make it work for varlistentry elements:
>
> <xsl:template match="varlistentry">
> <dt>
> <xsl:apply-templates select="." mode="class.attribute"/>
> <xsl:call-template name="anchor"/>
> <xsl:apply-templates select="term"/>
> </dt>
> <dd>
> <xsl:apply-templates select="." mode="class.attribute"/>
> <xsl:apply-templates select="listitem"/>
> </dd>
> </xsl:template>
>
>
> Bob Stayton
> Sagehill Enterprises
> [EMAIL PROTECTED]
>
>
> ----- Original Message ----- From: "Halm Reusser" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Monday, November 10, 2008 7:25 AM
> Subject: [docbook] Generating custom class attribute for HTML output
>
>
>> Hi all,
>>
>> What I have:
>>
>> <variablelist>
>> <varlistentry role="REQ">
>> <term>REQ-</term>
>> <listitem>
>> <para>This is an example requirement.</para>
>> </listitem>
>> </varlistentry>
>> </variablelist>
>>
>> What I want in my HTML output:
>>
>> <dl>
>> <dt class="REQ"> ... </dt>
>> <dd class="REQ"> ... </dd>
>> </dl>
>>
>> In the default, this do not work.
>>
>> So I'm refering to
>> http://www.sagehill.net/docbookxsl/HtmlCustomEx.html#CustomClassValues
>>
>> where I added this snippet to my HTML customization layer:
>>
>> <xsl:template match="[EMAIL PROTECTED] = 'REQ']" mode="class.value">
>> <xsl:value-of select="'REQ'"/>
>> </xsl:template>
>>
>> But this also not get me the wished result? Any ideas?
>>
>> Many thanks in advance.
>>
>> Halm
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
SWITCH
Serving Swiss Universities
--------------------------
Halm Reusser, Software Engineer, Security
Werdstrasse 2, P.O. Box, 8021 Zurich, Switzerland
phone +41 44 268 15 71, fax +41 44 268 15 68
[EMAIL PROTECTED], http://www.switch.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]