Hi Eric,
Take a look at this doc, which describes how to use mode="class.value" to generate custom class attribute values:

http://www.sagehill.net/docbookxsl/HtmlCustomEx.html#CustomClassValues

In your case, you would want to add a custom template starting with:

<xsl:template match="*[@revision]" mode="class.value">

and instead of just outputting the $class template param, you could add the value of @revision.

Bob Stayton
Sagehill Enterprises
b...@sagehill.net

On 3/18/2014 4:54 PM, Nordlund, Eric wrote:
Hi, sorry if this is a repeat message, I sent it a few hours ago and I still 
haven’t seen it on the list yet.
—————
Hello, I have a user guide that I am adding new features to and I want to 
signal the new content with a background color (like a light green or something 
like that).

Since all of the content for this feature is profiled with the “revision” 
attribute, I thought a smart way to do this would be to send the revision value 
through as a class and then add a css rule for the class, such as:

.feature-x {
background-color: green;
}

I think I should modify this template here:

<xsl:template match="*" mode="common.html.attributes">
<xsl:param name="class" select="local-name(.)"/>
<xsl:param name="inherit" select="0"/>
<xsl:call-template name="generate.html.lang"/>
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="$inherit"/>
</xsl:call-template>
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
<xsl:call-template name="generate.html.title"/>
</xsl:template>


But I can’t seem to figure out what to put there that works for profiled and 
non-profiled content without stripping the actual class value that should be 
there.


Am I thinking about this the right way, or is there an even easier wa to do 
what I want to accomplish?


Thanks a bunch in advance,


Eric


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

Reply via email to