[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Make better use of IDs in the HTML stylesheets?
Jean Jordaan wrote: > Consider putting the id in a place that actually identifies the entire > named section? The problem is that some older HTML browsers do not suppot ID attributes and it is thus necessary to emit <a name="..."/>. You can't have ID attribute with the same value on different element. But to accommodate your needs you can easily put ID into class attribute. Just add the following into your customization layer: <xsl:template match="*" mode="class.value"> <xsl:param name="class" select="local-name(.)"/> <!-- permit customization of class value only --> <!-- Use element name by default --> <xsl:value-of select="$class"/> <xsl:if test="@id | @xml:id"> <xsl:text> _</xsl:text> <xsl:value-of select="@id | @xml:id"/> </xsl:if> </xsl:template> Now, for <appendix id="foo"> you will get <div class="appendix _foo"> which you can easily access in CSS by .appendix._foo or by ._foo.appendix HTH, Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]