OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] transform td role to td class in HTML-output


Actually, the "class.value" mode isn't used with DocBook tables using HTML table markup. That's because such tables are pretty much passed through to the HTML output, minus any DocBook attributes. The td element's attributes are instead processed in mode="htmlTableAtt". In that mode, by default only HTML attributes are copied through. If the DocBook content was <td class="breedte-50"> then that class would appear in the output. However, if you want to transform @role, that mode is applied to all the source attributes, so this should work:

<xsl:template match="d:td/@role" mode="htmlTableAtt">
 <xsl:attribute name="class">
ÂÂÂ <xsl:value-of select="."/>
 </xsl:attribute>
</xsl:template>

I really need to update my book with all the changes that have been made to DocBook XSL.

Bob Stayton
bobs@sagehill.net
On 9/15/2020 5:21 AM, Peter Desjardins wrote:
Hi, Michel! I have some templates that use class.mode in my
customization. I can confirm that this XSL controls the class
attribute in output HTML:

  <xsl:template match="d:preface[@role = 'apiPortalHome']" mode="class.value">
    <xsl:value-of select="'apiPortalHome'"/>
  </xsl:template>

That template allows us to add some special CSS to a specific page in
a doc set. I added the template based on the excellent coverage in
http://www.sagehill.net/docbookxsl/HtmlCustomEx.html#CustomClassValues.

Can you share more about how you tried class.value? What was the result?

Peter

On Tue, Sep 15, 2020 at 6:26 AM Michel van den Burg <burg@coutinho.nl> wrote:
Hi everyone, I'm using the DocBook XSL to transform DocBook XML to EPUB and HTML. I would like to transform

td role="breedte-50"

to

td class="breedte-50"

in my HTML output, but unfortunately the output is

td

I have tried to use match:
docbook:td[@role = 'bron']

and I've tried the class.value mode. They both don't work.

I've read two posts (from 2010 and 2011) that address this topic. Is there a way to add classes to td's?

Thanks in advance,
Kind regards,
Michel



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]