David,
I can't make that guarantee of the space you mentioned. Can I make it
more simple if I split the string into Description and Amount as follows
(again, my goal is to align the descriptions and the decimal points):
<euro-tax-msg5>Quebec Native Seal Tax</euro-tax-msg5>
<euro-tax-msg5-amt>15.42</euro-tax-msg5-amt>
<euro-tax-msg6>BIG UPPER CASE TAX INO</euro-tax-msg6>
euro-tax-msg6-amt>439.59</euro-tax-msg6-amt>
--------------------------
Jeff
________________________________
From: David Gerdt [mailto:[EMAIL PROTECTED]
Sent: Monday, August 25, 2008 2:23 PM
To: [email protected]
Subject: Re: 0.95 - Printing a string and aligning the decimal
points
Assuming you can guarantee that there will always be at least
two spaces between the text and the digits, could you do something like
the following?
<fo:block white-space-collapse="false"
linefeed-treatment="preserve" text-align-last="justify" >
<xsl:text>
</xsl:text>
<xsl:call-template name="split">
<xsl:with-param name="string" select="euro-tax-msg5"
/>
</xsl:call-template>
<xsl:text>
</xsl:text>
<xsl:call-template name="split">
<xsl:with-param name="string" select="euro-tax-msg6"
/>
</xsl:call-template>
<xsl:text>
</xsl:text>
</fo:block>
<xsl:template name="split">
<xsl:param name="string" />
<xsl:variable name="first"
select="substring-before($string,' ')" />
<xsl:variable name="rest" select="substring-after($string,'
')" />
<xsl:value-of select="$first" /><fo:leader/><xsl:value-of
select="$rest" />
</xsl:template>
>>> "Steffanina, Jeff" <[EMAIL PROTECTED]> 8/25/2008
1:07 PM >>>
Friends,
Existing Code in my XML file (the decimal points are aligned
when using Courier font):
<euro-tax-msg5>Quebec Native Seal Tax
15.42</euro-tax-msg5>
<euro-tax-msg6>BIG UPPER CASE TAX INO
439.59</euro-tax-msg6>
--------------------------
My XSL that prints (using Arial font):
<fo:block white-space-collapse="false"
linefeed-treatment="preserve" text-align="start" >
<xsl:text>
</xsl:text>
<xsl:value-of select="./euro-tax-msg5"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="./euro-tax-msg6"/>
<xsl:text>
</xsl:text>
</fo:block>
-----------------------------
My Result:
Thelkj lk laksjf lkasjd flkajs flkj 15.42
Wakadf wlkej salksdjf HHHH 349.54
Without creating a table, is there a way to get the text to
align left and the digits to align right?
I thank you for any suggestions.
Jeff