Donate Share

Saxon XSLT and XQuery Processor

Tracker: Bugs

5 StringValue, Object and isAssignableTo - ID: 561695
Last Update: Settings changed ( mhkay )

I am using a StringBuffer to accumulate Strings in a
stylesheet.

When I run
<xsl:value-of select="stringBuffer:append($sentList,
concat('x',
''y'))"/>

I get the error :
There are several Java methods that match equally well.

StringBuffer.append takes a number of argument types.
Among these are
String and Object. I believe the problem lies with the
conversionPreferences method in StringValue. I made
the change
indicated below and my stylesheet ran as expected.

public int conversionPreference(Class required) {

// if (required.isAssignableFrom(StringValue.class))
return 0;

...

if (required==String.class) return 0;
if (required==Object.class) return 1;

// put this after the Object test. if required ==
Object
// then this test always returns true even when
there
// is a more specific value match.

if (required.isAssignableFrom(StringValue.class))
return 0;
return Integer.MAX_VALUE;
}


Brett Knights ( bknights ) - 2002-05-28 21:00

5

Closed

Fixed

Nobody/Anonymous

None

v6.5.2

Public


Comments ( 3 )

Date: 2003-08-07 11:43
Sender: mhkayProject Admin

Logged In: YES
user_id=251681

Fix applied to 6.5.3 (regression tested only)


Date: 2002-08-28 13:13
Sender: mhkayProject Admin

Logged In: YES
user_id=251681

Fixed in 7.2. Still present in 6.5.2 (and source code in 6.5.x
not yet corrected).


Date: 2002-08-27 13:56
Sender: mhkayProject Admin

Logged In: YES
user_id=251681

Applies to 7.1: source code fixed for 7.2 release. I've taken
the opportunity to revise all the conversion preferences to
reduce the cases where unnecessary ambiguities will be
reported (typically where there are two methods but both
would return the same result).

Also applies to 6.5.2: source code not yet fixed in this branch.


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2003-08-14 14:21 mhkay
resolution_id None 2003-08-14 14:21 mhkay
close_date - 2003-08-14 14:21 mhkay
artifact_group_id None 2002-08-27 13:56 mhkay