Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2334

XSLTResult does not work with stylesheets that use xsl:include or xsl:import

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.11
    • 2.1.1
    • Other
    • None
    • Patch

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              mrdon Donald J. Brown
              johndkrueger John Krueger
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: