Re: [xsl] Fill line ends with dots

Subject: Re: [xsl] Fill line ends with dots
From: "Linda van den Brink" <linda@xxxxxxxxxx>
Date: Fri, 15 Aug 2008 13:15:07 +0200
The problem is that the text is wrapped by the processor in the
content area of a block, so how do I know where the line ends will be?

On Fri, Aug 15, 2008 at 1:05 PM, Andrew Welch <andrew.j.welch@xxxxxxxxx>
wrote:
>> I'm looking for a way to fill the end of all lines in a (left-aligned)
>> block not with spaces, but with a character like a dot or a dash. I
>> don't think a leader is the answer here, because not only the end of
>> each block must be filled, but the end of each line within a block
>> given a certain area width, something like this (I hope the email
>> program doesn't mangle this):
>
> It did for me...  :)
>
>> Heden/Vandaag, 'datum ', heb ik, ' adellijke titel, titel, voornamen,
>> ------------
>> voorvoegsels, achternaam (kandidaat)notaris', hierna te noemen: notaris,
------
>> als waarnemer van ' adellijke titel, titel, voornamen,
>> voorvoegsels,---------------
>> achternaam notaris ' notaris te 'plaats van vestiging ' deze akte
onmiddellijk--
>> na beperkte voorlezing en na ondertekening door partijen ondertekend
ten------
>> overstaan van de volgende verschenen
>> persoon:-------------------------------------
>>
>> So far I haven't tried anything but have only been thinking about
>> this. All I've been able to come up with is using a background image
>> for the lines and displaying the text over that, so that were there's
>> no text the background image is visible.
>>
>> Is there a more direct/simple/elegant way to do this?
>
> I think the standard way is to define a variable holding the number of
> dashes to fill a line, say 10 for example:
>
> <xsl:variable name="dashes" select=" '----------' "/>
>
> then do:
>
> select="concat($str, substring($dashes, string-length($str))"
>
>
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/

Current Thread