Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.6
-
None
-
JDK 1.4.2_06
Windows XP/SP1
Description
The <source> tag does not apply @class attribute in apache-doc.xml file. For example the following text:
<source class="my_class">
My pre
formatted
text
</source>
Gets translated in this html:
<pre class="code">
My pre
formatted
text
</pre>
Note, that Forrest ignored the class="my_class" attribute/value in the original document.
Ross Gardler suggested the following:
--------
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>
-----------
I've tested with my local Forrest 0.6 installation by changing the \forrest-0.6\src\core\context\skins\common\xslt\html\document2html.xsl in the above described way. It worked just fine.
<source class="my_class">
My pre
formatted
text
</source>
Gets translated in this html:
<pre class="code">
My pre
formatted
text
</pre>
Note, that Forrest ignored the class="my_class" attribute/value in the original document.
Ross Gardler suggested the following:
--------
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>
-----------
I've tested with my local Forrest 0.6 installation by changing the \forrest-0.6\src\core\context\skins\common\xslt\html\document2html.xsl in the above described way. It worked just fine.