You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Victor Voronenko (JIRA)" <ji...@apache.org> on 2008/04/27 22:36:05 UTC

[jira] Commented: (WW-2334) XSLTResult does not work with stylesheets that use xsl:include or xsl:import

    [ https://issues.apache.org/struts/browse/WW-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43756#action_43756 ] 

Victor Voronenko commented on WW-2334:
--------------------------------------

Sorry, but this issue IS NOT QUITE RESOLVED.

It still generates the error for <xsl:include> in the latest XSLTResult.java class with enchanced error handling added by Don.

The error occurrs in execute() method right BEFORE Don's code that would set the transformer.setErrorListener:

if (location != null) {
    templates = getTemplates(location);
    transformer = templates.newTransformer();    // <----------  here (java.lang.NullPointerException)
} else
    transformer = TransformerFactory.newInstance().newTransformer();

The error message is:
ERROR [com.tss.admin.revreal.transform.XSLTResult] - Unable to render XSLT Template, '/WEB-INF/xsl/dealSheet.xsl'
java.lang.NullPointerException

SystemErr     R (Location of error unknown)Cannot handle procotol of resource /WEB-INF/xsl/applicationUtils.xsl

This misspelled word from the message can serve as a marker to find the origin of an error:    "p  r  o  c  o  t  o  l  " ("proCoTol" instead of "proToCol").

Googling this issue may bring a very old response from Don to add the "request:" prefix before the included URL, that is:
	<xsl:include href="request:/WEB-INF/xsl/applicationUtils.xsl"/>

Unfortunately, does not work for me.


> XSLTResult does not work with stylesheets that use xsl:include or xsl:import
> ----------------------------------------------------------------------------
>
>                 Key: WW-2334
>                 URL: https://issues.apache.org/struts/browse/WW-2334
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>            Reporter: John Krueger
>            Assignee: Don Brown
>             Fix For: 2.1.1
>
>
> Imported or included xslt stylesheets are not found when using the XSLTResult type.
> According to the javadoc for the org.apache.struts2.views.xslt.ServletURIResolver class, the href atttribute on the following xslt element should allow the transformer to retrieve the resource, common.xsl, but Xalan does not find it.
>   <xsl:include href="response:WEB-INF/xslt/common.xsl"/>
> After debugging the struts2 source, the problem is that in the XSLTResult class the URIResolver is not being set on the TransformerFactory instance in the getTemplates() method before the xslt source is processed into a Templates object.  I have made and tested this changed in a source build and will try to attach a patch for this fix.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.