OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Problem using leader-pattern


Hi,
This is a problem with your XSL code:

<xsl:template match="d:title[@role = 'job']" mode="list.title.mode">
  <fo:block text-align-last="justify">
    <xsl:value-of select="."/>    <!-- Left-hand text -->
    <fo:leader leader-pattern="dots"/>
    <xsl:value-of select="date"/> <!-- Right-hand text -->
  </fo:block>
</xsl:template>

The context node for this template is title.  When you use xsl:value-of 
select=".", you are selecting all the text content of the title, including 
any text in child elements like date.  So that gives you the list's title 
plus the date.  You get a blank space before the date because of the line 
break whitespace before date in your source.

The xsl:value-of select="date" lacks a namespace prefix on "date", and so it 
does not match anything.  If that were d:date, then you would get a date 
after the leader dots as well.

I think you should use:

<xsl:apply-templates select="node()[not(self::d:date)]"/>
<fo:leader leader-pattern="dots"/>
<xsl:value-of select="d:date"/>

The first line processes everything in the title except date.  I use 
apply-templates because a title can have subscripts and other child elements 
that need processing.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "William R. (Bill) Greene" <wrg@acm.org>
To: <docbook-apps@lists.oasis-open.org>
Sent: Monday, June 16, 2008 9:18 AM
Subject: [docbook-apps] Problem using leader-pattern


> Given the following DocBook and stylesheet source, why does the XEP- 
> rendered
> 'date' component of the title precede the leader?  Note that if I  replace 
> the
> two 'xsl:value-of's with literal text (as in Appendix A of Dave Pawson's
> "XSL-FO" book), the leader separates them, as I intended.
>
> DocBook 5.0 source:
>
>     <itemizedlist>
>       <title role="job">Possum Technologies, Consultant
>       <date>2001-2008</date>
>       </title>
>
>       <listitem><para>
>         ...
>
> DocBook XSL-NS Stylesheets 1.74.0 source:
>
>   <!-- Modified from fo/lists.xsl: -->
>   <xsl:template match="d:title[@role = 'job']" mode="list.title.mode">
>     <fo:block text-align-last="justify">
>       <xsl:value-of select="."/>    <!-- Left-hand text -->
>       <fo:leader leader-pattern="dots"/>
>       <xsl:value-of select="date"/> <!-- Right-hand text -->
>     </fo:block>
>   </xsl:template>
>
> Rendered:
>
>   Possum Technologies, Consultant 2001-2008 ...............
>
> Desired:
>
>   Possum Technologies, Consultant ............... 2001-2008
>
> _______________________________________________________________________
>
>    -- Bill Greene
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
> 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]