I don't think there's a correct answer to this one. The JAXP specification isn't explicit enough on this kind of question. Perhaps you should raise a comment on the JAXP 1.1 specification and see if we can get the spec improved. I'm reluctant to make ad-hoc changes to Saxon just because another product has interpreted the spec differently: it's highly likely that such changes would cause something else to break.
 
Michael Kay
-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Ytai Ben-Tsvi
Sent: 21 August 2002 15:58
To: Saxon Help List
Subject: [saxon] uri-resolver

Hi,

There’s a problem with saxon 6.5.2 when working with cocoon – I can’t say it’s a bug, but it is certainly a strange behaviour:

 

Cocoon caches Templates objects for later use. When they’re needed it passes this object to the TransformerFactoryImpl of saxon, requesting a new TransforerHandler. The Templates object (PreparedStyleSheet in this case) holds a reference to the factory that was ORIGINALLY used to build it and thus, the new TransformerHandler that’s returned, uses the URIResolver that was given to the original factory, and in the case of working with cocoon, this object is usually an object (TraxTransformer) that was already recycled, its uriResolver nullified. I think it might be more logical to re-set the URIResolver of the Controller object before returning it, as if a brand new handler was created from the source XSL.

 

Mike, I would like to hear your opinion on the subject, it might be that cocoon is abusing the Templates interface, but still, it’s a problem if these objects can’t be cached.

 

Thanks

 

Ytai Ben-Tsvi