cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20308] - Stylesheet includes not working with XSLTC
Date Thu, 04 Sep 2003 17:19:12 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20308>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20308

Stylesheet includes not working with XSLTC





------- Additional Comments From phil@juniper.net  2003-09-04 17:19 -------
From:     Phil Shafer <phil@idle.juniper.net>
To:       xalan-dev@xml.apache.org
Subject:  PR 20308
Date:     Fri, 15 Aug 2003 16:41:43 -0400

I'm seeing a problem running xalan 2.5.1 that is related to PR 20308.

<xsl:import>s are losing the relative directory, because the
systemId for imported stylesheets is not fully qualified and
any relative path from the current stylesheet is dropped. This
problem is seen when a stylesheet is imported with a relative
path imports another stylesheet using a relative path.

The fix I came up with is:

*** orig/src/org/apache/xalan/xsltc/compiler/Import.java        Fri May 30
11:07:01 2003
- --- src/org/apache/xalan/xsltc/compiler/Import.java   Fri Aug 15 16:21:45 2003
***************
*** 106,111 ****
- --- 106,112 ----
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
                input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
+               docToLoad = input.getSystemId();
                reader = xsltc.getXMLReader();
            }
            else {
*** orig/src/org/apache/xalan/xsltc/compiler/Include.java       Fri May 30
11:06:39 2003
- --- src/org/apache/xalan/xsltc/compiler/Include.java  Fri Aug 15 16:21:35 2003
***************
*** 107,112 ****
- --- 107,113 ----
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
                input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
+               docToLoad = input.getSystemId();
                reader = xsltc.getXMLReader();
            }
            else {


This patch is similar too the suggested fix for 20308, which is:

***************
*** 158,164 ****
            if (_included == null) return;
  
            _included.setSourceLoader(loader);
!           _included.setSystemId(docToLoad);
            _included.setParentStylesheet(context);
            _included.setIncludingStylesheet(context);
            _included.setTemplateInlining(context.getTemplateInlining());
- --- 159,165 ----
            if (_included == null) return;
  
            _included.setSourceLoader(loader);
!           _included.setSystemId(input.getSystemId());
            _included.setParentStylesheet(context);
            _included.setIncludingStylesheet(context);
            _included.setTemplateInlining(context.getTemplateInlining());

Except that this second fix does not change docToLoad, since is only
used in error messages.  I followed the style of the 'else' clause
which does update docToLoad.

In either case, please be sure to repair Import.java when you
fix Include.java.

Thanks,
 Phil

Mime
View raw message