XSL-FO and decimal alignment

I’m trying to line up a column of numbers using XSL-FO. The numbers can be any mix of positive and negative numbers. Because they represent currency, text-align=“end” worked fine because all values had two digits after the decimal place with format-number(value, “#,##0.00”)

However, the user wants negative numbers to display with parentheses. No prob: format-number(value, “#,##0.00;(#,##0.00)”) right? The problem is now the decimals do not line up because of that trailing ).

What makes things more frustrating is: when I googled “xsl fo align decimal place” the first link was http://groups.yahoo.com/group/XSL-FO/message/5530 This appears to be what I’m looking for, but I’m not allowed to surf to yahoo.com by the rules of our firewall filter (grrrr… I dread the day straightdope.com is added to that database!) Can you check this out to see if there’s any help?

I’m going to go with


<xsl:value-of select="substring-before(format-number(value, '#,##0.00;(#,##0.00)'), '.')" />
<xsl:text>.</xsl:text>
<fo:leader leader-pattern="use-content" leader-length="3em" leader-pattern-width="3em">
  <xsl:value-of select="substring-after(format-number(value, '#,##0.00;(#,##0.00)'), '.')" />
</fo:leader>

All that to display one number that, without the “display negatives in parentheses” requirement, would merely have been

<xsl:value-of select=“format-number(value, '#,##0.00” />

There must be a better way…

Found it (sorta)

http://www.dpawson.co.uk/docbook/styling/fo.html#d2635e931
says that the answer is text-align="’.’", i.e. the single quoted string “dot” within the double quotes.

However, we’re using XEP to render FO and
http://www.renderx.com/reference.html#ftn.d0e2370
says it’s not implemented.
So, allow me to modify the original question thusly,

  1. is there a better way other than text-align="’.’"? The values are in a table and I considered having a column for left of decimal and a column for right, but rejected in as costing too much in maintenance later if formatting ever changes.

  2. This may be more IMHO, but… What alternatives to XEP would you suggest? Not only would something more fully implemented be welcome, but something that renders way faster - esp. with huge (50MB - 100 MB or larger) FO files?