forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: Appling CSS class to the source tag in apache doc
Date Fri, 11 Feb 2005 23:44:29 GMT
Stefan Baramov wrote:
> May be I am mistaken but the class attribute of "source" tag does not
> work in Forrest 0.6 for the "pelt" skin. 
> 
> I have an xml file defined like this
> 
> <source class="my_class">
> 	My pre
> 		formatted 
> 			text
> </source>
> 
> This always will result in 
> 
> <pre class="code">
> 	My pre
> 		formatted 
> 			text
> </pre>
> 
> Notice, that instead of "my_class" the "code" class is used. My question
> is why? Is this skin specific? Or a bug? 

The source tag has a specific meaning hence the class="code" attribute. 
However, the skin should really allow the user to pass class information 
  in the way you illustrate in order to allow custom styling. I would 
consider this a bug, please file a bug report.

I think a solution is to change the following in 
main/webapp/skins/common/html/document2html.xsl:

   <xsl:template match="source">
     <xsl:apply-templates select="@id"/>
     <pre class="code">

to:

   <xsl:template match="source">
     <xsl:apply-templates select="@id"/>
     <pre>
	<xsl:attribute name="class">
		<xsl:apply-templates select="@class"/>, code
	</xsl:attribute>

Please test it and let us know if this works.

Ross



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 10/02/2005


Mime
View raw message