This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
[docbook] Re: line break
- From: Yoshihiro Toda <ystoda at yahoo dot co dot jp>
- To: docbook at lists dot oasis-open dot org
- Date: Fri, 16 Apr 2004 14:49:04 +0100
- Subject: [docbook] Re: line break
- References: <20040416115056.GA25632@nl.linux.org>
Inserting <br> in DocBook always needs some way round.
You can slightly modify XSL stylesheet, "inline.xsl" like:
<!-- code starts here -->
<xsl:template match="quote">
<xsl:variable name="depth">
<xsl:call-template name="dot.count">
<xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$depth mod 2 = 0">
<xsl:if test="@role='dialog'"><br/></xsl:if>
<xsl:call-template name="gentext.startquote"/>
<xsl:call-template name="inline.charseq"/>
<xsl:call-template name="gentext.endquote"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.nestedstartquote"/>
<xsl:call-template name="inline.charseq"/>
<xsl:call-template name="gentext.nestedendquote"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--code ends-->
I just added "<xsl:if test="@role='dialog'"><br/></xsl:if>". You can insert
this simply in your XSL customisation layer. Now if you markup a dialog like
"...he said <quote role="dialog">...</quote>", then <br> (converted from
<br/>) is put before the quote.
The part "<xsl:otherwise..." is a "quote in a quote", so you won't want
to add newline (or you may want; just add the same "<xsl:if..." to the
"otherwise" part).
--
Yoshihiro Toda
<mailto:ystoda@yahoo.co.jp>
__________________________________________________
Do You Yahoo!?
http://bb.yahoo.co.jp/
To unsubscribe from this list, send a post to docbook-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.