Re: [xsl] debugging document() call

Subject: Re: [xsl] debugging document() call
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 30 Jun 2010 20:02:22 +0100
Sorry, I don't know Cocoon or Excalibur so I can't help you much with the specifics. The standard URIResolver used by Saxon is net.sf.saxon.StandardURIResolver, but it's quite likely that Cocoon uses a different URIResolver of its own. You're looking for classes that implement the interface javax.xml.transform.URIResolver.

The Saxon SourceResolver class is something quite different (and probably unrelated to the similarly-named class that you found in Cocoon).

Michael Kay

On 30/06/2010 19:44, Lars Huttar wrote:
On 6/30/2010 11:35 AM, Michael Kay wrote:
The document() call still doesn't fetch anything, and the log that shows
SourceResolverImpl debugging output doesn't show an attempts to access
the relative URI.

Any other ideas?

Subclass the standard URI resolver with your own and see how it's
being called.

Thanks for this suggestion.

I'm not really up on the development process for subclassing a class in
a lib jar file, or determining which class to subclass, but I'm taking a
stab at it.

First, rather than subclassing, I modified Cocoon's, inserting debug logging into resolveURI().
However that doesn't seem to be the right class to be looking at.
Although my new debug logging appeared once, it did not appear with
every URI resolution.
The class that *is* logged many times with URI resolution seems to be
SourceResolverImpl. Would that be right?
AFAICT this is an Excalibur class,
Since I don't have source code for this class in the Cocoon build tree,
it will be harder for me to figure out how to subclass it or modify it.

But according to the logging, SourceResolverImpl isn't being called at
all for the URI that is passed to document().
So wouldn't this be a dead end?
Maybe I'm barking up the wrong tree trying to modify Cocoon's classes...

Maybe when you say "the standard URI resolver" you are referring to
javax.xml.transform.URIResolver? or Saxon's subclass of it?
I'm getting to a point where I definitely need more hand-holding on how
to do this...
I see that "A SourceResolver can be registered as part of the
Configuration, and enables new kinds of Source to be recognized beyond
those that are natively recognized by Saxon."

What class should I subclass, and how do I get Saxon to use my subclass?


Current Thread