[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: debugging document() call

Subject: Re: debugging document() call
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 30 Jun 2010 20:02:22 +0100
Re:  debugging document() call
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
Saxonica

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
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.