[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Hairy translate() Problem

Subject: Hairy translate() Problem
From: "Bruce Long (c)" <blong@xxxxxxxxxxx>
Date: Wed, 9 Aug 2000 01:28:28 -0400
hairy
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,
'&#8216;&#8217;&#8220;&#8221;', '``')"/>
.
.
.

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 &#8216;safety net&#8217;
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@xxxxxxxxxxx>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.