Re: [docbook-apps] Different colored admonitions

From
Bob Stayton <>
Date
2006-10-05T21:25:07+00:00
ID
013701c6e8c4$bbbdccd0$7d711bac@totoro
Thread
Re: [docbook-apps] Different colored admonitions
You can put an xsl:choose statement inside an 
xsl:attribute inside the xsl:attribute-set, because the attribute-set is read 
each time it is used, so it can change for different contexts. Something like 
this:

 

<xsl:attribute 
name="background-color">

  <xsl:choose>

    <xsl:when 
test="ancestor-or-self::note">#FFEEFF</xsl:when>

    ...

    
<xsl:otherwise>inherit</xsl:otherwise>

  </xsl:choose>

</xsl:attribute>

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

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

  
From: 
  Nelson, Dean 

  
To: Docbook Apps 

  
Sent: Wednesday, October 04, 2006 12:46 
  PM

  
Subject: [docbook-apps] Different colored 
  admonitions

  

  

  
All,

  
 

  
I have this for my 
  admonitions:

  
 

  
    <xsl:attribute-set 
  name="admonition.properties">

  
        
  <xsl:attribute 
  name="keep-together.within-column">always</xsl:attribute>

  
        
  <xsl:attribute name="border">0.5pt solid 
  blue</xsl:attribute>

  
       
   <xsl:attribute 
  name="background-color">#FFEEFF</xsl:attribute>

  
    
  </xsl:attribute-set>

  
    <xsl:attribute-set 
  name="admonition.title.properties">

  
        
  <xsl:attribute 
  name="keep-together.within-column">always</xsl:attribute>

  
        
  <xsl:attribute 
  name="background-color">#E0E0E0</xsl:attribute>

  
        
  <xsl:attribute 
  name="text-align">center</xsl:attribute>

  
        
  <xsl:attribute name="border">0.5pt solid 
  blue</xsl:attribute>

  
    
  </xsl:attribute-set>

  
 

  
What I want to do is make each admonition a different 
  color. 

  
Tip/info =green

  
warning =red 

  
etc

  
 

  
I assume there is a template somewhere where I can 
  slide it into my customization layer?

  
 

  
Dean