Re: [docbook-apps] Assigning Default Role Values to Elements

From
"Cob Rtayton"
Date
2006-11-06T07:29:27+00:00
ID
08e501c70175$33e16780$6400a8c0@totoro
Thread
Re: [docbook-apps] Assigning Default Role Values to Elements
Hi Ray,

I still don't understand your usage of the word 
"default" here.  I get the part about you wanting to pass through 
role attributes as class values on your titles.  But those role values are 
to be entered by the author, and are not default values.  In the case of 
DocBook's HTML output, the default class values are added by the XSL 
stylesheet:

 

<div class="chapter"><div 
class="titlepage"><div><div><h2 class="title">

 

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.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Miller, Ray 
  (Centech) 

  
To:  
  

  
Sent: Saturday, November 04, 2006 9:19 
  AM

  
Subject: RE: [docbook-apps] Assigning 
  Default Role Values to Elements

  

  

  

  
>> 
  I understand that you want to 
  propagate role values to class attributes in the HTML, but I'm not clear on 
  what you mean by assigning default role values to elements.  That is 
  usually a function of the DTD.  Can you give an example of what you 
  mean? 
  <<

  
 

  
 

  
Given the enterprise 
  CSS class selectors:

  
--------------------------------------------------

  
.foo-section-header 
  {

  
      
  padding: 3px;

  
      
  background-color: #6B1424;

  
      
  color: #FFFFFF;

  
      
  font-weight: bold;

  
      
  font-size: 115%;

  

  
}

  
.foo-paragraph-header 
  {

  
      
  font-weight: bold;

  
      
  color: #6B1424;

  
} 

  
.foo-emphasis 
  {

  
      
  font-style: italic;

  
}

  
.foo-bold 
  {

  
      
  font-weight: bold;

  
}

  
------------------------------------------------

  
 

  
the following DocBook 
  element roles would be applied:

  
 

  
----------------------------------------------------------------------------------------------

  
<chapter><phrase 
  role=”foo-section-header”>Foo</phrase></chapter>

  
<sect1><phrase 
  role=”foo-paragraph-header”>Foo</phrase></sect1>

  
<sect2><phrase 
  role=”foo-paragraph-header”>Foo</phrase></sect2>

  
<sect3><phrase 
  role=”foo-paragraph-header”>Foo</phrase></sect3>

  
<sect4><phrase 
  role=”foo-paragraph-header”>Foo</phrase></sect4>

  
<sect5><phrase 
  role=”foo-paragraph-header”>Foo</phrase></sect5>

  
<emphasis 
  role=”foo-emphasis”>foo</emphasis>

  
<emphasis 
  role=”foo-bold”>foo</emphasis>

  
----------------------------------------------------------------------------------------------

  
 

  
What I overlooked is 
  that propagates.style is not supported in 
  chapter or section titles.

  
 

  
So the question 
  regarding default roles would apply to elements of which propagates.style is supported in the 
  stylesheets.

  
 

  
Would 
  chapter-title.propagates.style and 
  section-title.propagates.style be considered a 
  viable feature request in forthcoming stylesheet 
  releases?

  
 

  
As most other common 
  DocBook elements support propagates.style, the aforementioned 
  request combined with default element role inclusions and values would result 
  in integrated presentation-layer conformance; the holy grail of content 
  publishing ‘round here.

  
 

  
Ray