This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Hairy translate() Problem


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@sapient.com>


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]