Dave Carlson wrote:
>I need to use the Saxon XSLT processor with Jetspeed for other portlet content
>(and another application running in the same Tomcat instance). However, I was
>getting errors when I added saxon as the default XSLT processor. I tracked
>down a simple bug fix to SimpleTransform.java
>
>Short answer:
>Do a global replace of "getReader" and replace with "getURL"
>
It is not this simple. The whole purpose of having getReader() called is
to abstract Character encoding *and* cache location issues. getURL()
should be forbiden, as it exposes the internals on how the cache works,
and is bound to failure as the cache changes. Also, it leads to funny
character encoding issues.
>
>When SimpleTransform fetches the stylesheets from the disk cache, it creates a
>SAX parser based on a Reader for the cached file. However, in Saxon, it
>requires setSystemId() to be called on the Source so that the parser can use
>the source's systemId to determine the base URI for resolving relative URLs.
>
I think a Entity Resolver can take care of this process. I'm not
completely sure how, though.
I would like to help with a cleaner fix. I think we could call
setEntityResolver() on the InputSource with the true URL (not the one in
the cache), so that, in case there are relative URLs they can be resolved.
I imagine something like:
is = new InputSource( cacheEnt.getReader() );
is.setSystemID( cacheEnt.getSourceURL() );
is.setEntityResolver( new
org.apache.jetspeed.xml.JetspeedXMLEntityResolver() );
patching JetspeedXMLEntityResolver to setSystemID again on the resulting
InputSource ...
I will try this with saxon and report. What do you think?
Please remember me. I'm just too busy.
>
>This can be fixed by setting the systemId after constructing the Source with
>the Reader. But, it's simpler to just create the Source from the URL of the
>cached stylesheet. The global change above does this. Now, I can
>successfully run with Saxon. (But note that you must use the most current
>Saxon version, 6.4.3, do to a bug fix in Saxon.)
>
>Can someone make this change in CVS?
>
>Cheers,
> Dave Carlson
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]