This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[docbook] Re: line break


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/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]