Re: [xsl] debugging document() call

Subject: Re: [xsl] debugging document() call
From: Lars Huttar <lars_huttar@xxxxxxx>
Date: Wed, 30 Jun 2010 13:44:17 -0500
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
SimpleSourceResolver.java, 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,
org.apache.excalibur.source.impl.SourceResolverImpl
<http://www.jarfinder.com/index.php/java/info/org.apache.excalibur.source.impl.SourceResolverImpl>
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...
From
http://saxon.svn.sourceforge.net/viewvc/saxon/trunk/bj/net/sf/saxon/SourceResolver.java?revision=4&view=markup
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?

Thanks,
Lars

Current Thread