Next in thread →
Next in month →
RE: [docbook-apps] Assigning Default Role Values to Elements
For the short term, you might be able to get what you want
using xsl:apply-imports in your customization layer:
<xsl:template match="chapter">
<div
class="foo">
<xsl:apply-imports/>
</div>
</xsl:template>
That way you get to wrap the chapter in your div without
touching the docbook xsls. Of course you end up with a bunch of extra divs
:-)
David
From: Bob Stayton [mailto:]
Sent: Tuesday, November 07, 2006 11:20 AM
To: Miller, Ray
(Centech);
Subject: Re:
[docbook-apps] Assigning Default Role Values to Elements
OK, now I understand. I don't know of an
easy way to do what you are looking for with the current stylesheets.
There are dozens of instances of these in the HTML stylesheets:
<div class="{name(.)}">
and
<span
class="{name(.)}">
(actually, those should be local-name() for DB5
now that I look at it).
To get different class attributes, you would have
to replace each of those with a template that generates the class
attribute:
<div>
<apply-templates select="."
mode="html.class"/>
The default version of that mode would
be:
<xsl:template match="*"
mode="html.class">
<xsl:attribute
name="class">
<xsl:value-of
select="local-name(.)"/>
</xsl:attribute>
</xsl:template>
But you could customize that mode to output your
enterprise class names for specific elements.
This would make a fine feature request.
8^)
Bob Stayton
Sagehill Enterprises
DocBook Consulting
----- Original Message -----
From:
Miller, Ray
(Centech)
To:
Sent: Monday, November 06, 2006 6:33
AM
Subject: RE: [docbook-apps] Assigning
Default Role Values to Elements
Second sentence
should read ‘… for specific elements’ not
attributes.
From:
Miller, Ray (Centech)
Sent: Monday, November 06, 2006 9:30
AM
To:
Subject: RE: [docbook-apps] Assigning
Default Role Values to Elements
>>One can write CSS
selectors to match on these default class values. It looks like you
are looking to override the default class values with other values using the
role attribute. Is that because you want the authors to be able to
assign different styles to different chapter titles? Your example only
showed one style, so I wasn't sure if that's what you intended.<<
CSS class selectors
are pre-defined by the enterprise. So yes, wish to override class selectors
for specific attributes. Currently do so with phrase, emphasis and para
elements; wish to accomplish this transparently though a stylesheet
customization. As for the chapter and section titles, they must too conform
to the enterprise CSS which does not rely on <h1> <h2>
<h3> … for chapter and section title formatting in user content areas,
instead utilizing custom CSS class selector names. What I wish to accomplish
is a stylesheet customization that conforms to the enterprise’s CSS without
having to apply role= in elements or wrapping Chapter and Section
titles with phrase elements. In short, transparent enterprise CSS
conformance. This is a MAJOR issue that must be resolved for DocBook
enterprise Internet and Intranet acceptance; authors need to focus on
artifact content and structure only; presentation must be pre-defined and
transparently conformant.
Ray
Next in thread →
Next in month →