This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Hairy translate() Problem
- To: "Xsl-List (E-mail)" <xsl-list at mulberrytech dot com>, "Xmlxslt-Devel (E-mail)" <xmlxslt-devel at lists dot sourceforge dot net>
- Subject: Hairy translate() Problem
- From: "Bruce Long (c)" <blong at sapient dot com>
- Date: Wed, 9 Aug 2000 01:28:28 -0400
- Cc: Binh Tu <binhtu at sapient dot com>, Chris Macomber <cmacomber at sapient dot com>
- Reply-To: xsl-list at mulberrytech dot com
Hi All,
I am trying to use the following code involving the translate() function to
replace any 'macintosh quote marks' with Interwoven friendly quote marks. I
use the unicodes to identify the Mac characters.
.
.
.
<xsl:variable name="paragraphstring" select="string(text())"/>
<xsl:variable name="filteredparagraph" select="translate($paragraphstring,
'‘’“”', '``')"/>
.
.
.
PROBLEM: Excelon stylus runs this XSLT with no problems. However, Xalan
truncates the text in the PCDATA element to which the translate() function
is being applied when it comes across one of the control characters.
Source
<body_text_paragraph>Farmers have been handed an 11th hour GST safety net.
Those who have not registered for the GST, or have not received their
Australian Business Number (ABN), have been thrown a temporary lifeline to
prevent their buyers retaining 48.5pc of the gross sale proceeds in
withholding tax.
Farmers who do not possess an ABN can obtain a ‘safety net’
letter from the Australian Tax Office so when they supply other businesses,
tax will not be required to be withheld under the new Pay As You Go
arrangements.
For businesses with the letter, the rate of withholding tax has been
reduced from 48.5 per cent to nil. The variation covers the period from July
1 to July 31 inclusive, but will lapse as soon as the business is notified
of their ABN.</body_text_paragraph>
</body_text>
Excelon Stylus Results/Output (GOOD)
<value>Farmers have been handed an 11th hour GST safety net. Those who have
not registered for the GST, or have not received their Australian Business
Number (ABN), have been thrown a temporary lifeline to prevent their buyers
retaining 48.5pc of the gross sale proceeds in withholding tax.
Farmers who do not possess an ABN can obtain a `safety net` letter from the
Australian Tax Office so when they supply other businesses, tax will not be
required to be withheld under the new Pay As You Go arrangements.
For businesses with the letter, the rate of withholding tax has been
reduced from 48.5 per cent to nil. The variation covers the period from July
1 to July 31 inclusive, but will lapse as soon as the business is notified
of their ABN.
</value>
Xalan Results/Output (TRUNCATED)
<value>Farmers have been handed an 11th hour GST safety net. Those who have
not registered for the GST, or have not received their Australian Business
Number (ABN), have been thrown a temporary lifeline to prevent their buyers
retaining 48.5pc of the gross sale proceeds in withholding tax. Farmers who
do not possess an ABN can obtain a </value>
Why does Excelon translate this while Xalan has an error? Is it something to
do with Unicode code pages or sets?
Thanks and Regards,
Bruce.
Bruce Long (c)
Sapient | Architects for the New Economy
Level 13, 60 Castlereagh Street Phone: +612 9210.2067
Sydney, NSW 2000 Fax: +612 9210.2500
Australia
Email: <blong@sapient.com>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list