[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] Embedding XML schema into DocBook document
Allison Bloodworth wrote:
> in XML Mind was the fact that although their param.xsl stylesheet had the
> monospace.verbatim.properties attribute-set, it didn't have the wrap-option
> attribute at all...I had added it. Whereas in the new (ver 1.66.1) DocBook
> stylesheets, it already had the wrap-option attribute; I just changed the
> value to "wrap". When I did the transform in saxon and fop using the old XML
> Mind stylesheets where I had added the attribute, the programlistings didn't
> wrap.
The reason for this behaviour is that in older versions of the
stylesheets wrap property was hardwired into stylesheets and it was not
possible to override it by attribute set.
> 1) Does changing the wrap-option on this attribute-set only affect
> "programlisting"?
It affect all monospaced verbatim elements -- namely screen and may be
few others that I can't name from the top of my head.
> 2) Is there a way to fix this problem in the html? I tried adding the
> declaration to docbook-xsl-1.66.1/html/param.xsl, but got a stylesheet
> compile error that said "No attribute-set exists named monospace.properties"
HTML stylesheets translate programlisting into <pre> element. You can
use CSS to control appearance of HTML elements. If you have browser with
CSS 2.1 support you can use
.programlisting { white-space: pre-wrap }
AFAIK none browser support this. Instead you can try:
.programlisting { white-space: nowrap }
and modify stylesheets to substitute spaces in programlisting by
and line-breaks by <br>. Try add following template into your
customization layer:
<xsl:template match="programlisting">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:call-template name="anchor"/>
<xsl:variable name="rtf">
<xsl:apply-templates/>
</xsl:variable>
<xsl:variable name="content">
<p class="programlisting">
<xsl:call-template name="make-verbatim">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</xsl:variable>
<xsl:choose>
<xsl:when test="$shade.verbatim != 0">
<table xsl:use-attribute-sets="shade.verbatim.style">
<tr>
<td>
<xsl:copy-of select="$content"/>
</td>
</tr>
</table>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
--
------------------------------------------------------------------
Jirka Kosek e-mail: jirka@kosek.cz http://www.kosek.cz
------------------------------------------------------------------
Profesionální školení a poradenství v oblasti technologií XML.
Podívejte se na náš nově spuštěný web http://DocBook.cz
Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
S/MIME Cryptographic Signature
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]