I'm no expert, but I would have thought this would work (in the
customization layer):

<xsl:template match="d:*[@revision]" mode="class.value">
   <xsl:value-of select="'feature-x'" />
</xsl:template>

--Tim



On Wed, Mar 19, 2014 at 3:31 PM, David Cramer <[email protected]> wrote:

> On 03/18/2014 06: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.
>
> Hi Eric,
> One approach would be to match text nodes that have an ancestor with the
> desired attribute. The following example adds a <span class="remark">
> around all text that has an ancestor element with role="highlight". I
> then use css to add the yellow highlight to .remark:
>
>     <xsl:template match="text()[ ancestor::*/@role = 'highlight' and
> not(ancestor::d:programlisting) ] | xref[ ancestor::*/@role =
> 'highlight' and not(ancestor::d:programlisting)]" priority="10"><span
> class="remark"><xsl:apply-imports/></span></xsl:template>
>
> You would add this to your customization layer.
>
> This can add a bunch of spans, but does the job without needing to muck
> around in a bunch of templates.
>
> Regards,
> David
>
> > ----------
> > 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to