Re: AW: AW: AW: [xep-support] XSLFO: trouble with text-align-last="justify" and linefeed-treatment="preserve"

From: G. Ken Holman <>
Date: Mon Jan 21 2008 - 12:02:30 PST

At 2008-01-21 18:45 +0100, Kirch Fritz wrote:
>Do you have at least an example how to tokenize the name node texts
>at CRLF with XSLF 1.0 in order to build my blocks as intended?

I read the above as "XSL-FO 1.0", not "XSLT 1.0" ... sorry ... below
is an example using XSLT 1.0.

Tokenization is accomplished using substring-before and
substring-after in a recursive template call. A common design
pattern for XSLT 1.0 that is rarely needed when using XSLT 2.0.

I hope this helps.

. . . . . . . . . Ken

T:\ftemp>type fritz.xml
   <name>a very long text
having CRLF
   <name>short text</name>

T:\ftemp>type fritz.xsl
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl=""

<xsl:output indent="yes"/>

<xsl:template match="/">

<xsl:template match="Address">
     <xsl:call-template name="tokenize-blocks">
       <xsl:with-param name="text" select="name"/>
       <xsl:with-param name="suffix" select="phonenumber"/>

<xsl:template name="tokenize-blocks">
   <xsl:param name="text"/>
   <xsl:param name="suffix"/>
     <xsl:when test="contains($text,'&#xa;')">
         <xsl:value-of select="substring-before($text,'&#xa;')"/>
       <xsl:call-template name="tokenize-blocks">
         <xsl:with-param name="text" select="substring-after($text,'&#xa;')"/>
         <xsl:with-param name="suffix" select="$suffix"/>
       <block text-align-last="justify">
         <xsl:value-of select="$text"/>
         <leader leader-pattern="dots"/>
         <xsl:apply-templates select="$suffix"/>

T:\ftemp>xslt fritz.xml fritz.xsl con
<?xml version="1.0" encoding="utf-8"?>

    <block>a very long text </block>
    <block>having CRLF </block>
    <block text-align-last="justify">characters<leader

    <block text-align-last="justify">short text<leader


World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman       
Crane Softwrights Ltd.
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07
Legal business disclaimers:
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
Received on Mon Jan 21 12:56:55 2008

This archive was generated by hypermail 2.1.8 : Mon Jan 21 2008 - 12:56:56 PST