Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 89062 invoked by uid 500); 18 Sep 2001 14:33:42 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 89039 invoked from network); 18 Sep 2001 14:33:41 -0000 Message-ID: <3BA75B3A.14EE31DA@levigo.de> Date: Tue, 18 Sep 2001 16:33:30 +0200 From: Joerg Henne X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: de,en,fr MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: [Fwd: [C2] Bug in XSLTProcessorImpl?] Content-Type: multipart/mixed; boundary="------------C2A17D679D4584456E924D60" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --------------C2A17D679D4584456E924D60 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit [This is a re-post of a pending patch. Dims: the attached patch contains the version of the patch modified to your wishes.] Joerg Henne wrote: > > Hi, > > there seems to be a problem with the XSLTProcessorImpl which surfaces under > very special circumstances. If an entity catalog is used from within an > included xslt stylesteet, the following situation ensues: > > - the XSLTProcessorImpl's resolve method resolves the included stylesheet's > name against a base like "file:/path/to/including/stylesheet". > - due to the way it works, it prepends a leading slash after the colon leading > to a result like "file://path/to/included/stylesheet". This uri is broken, > however, cocoon's SourceResolver is still able to use it. > - the entity catalog used within the included stylesteet is looked up based on > the above uri. This eventually fails as xerces' DefaultReaderFactory creates a > URL from the uri and tries a URL.openStream() leading to a host lookup for > "path" and further mayhem. > > This problem seems to be specific to the unix platform (tested under > Linux/JDK1.3) due to the fact that URLs of the style "file:/x:/path/..." work > just like those without the first slash. > The attached patch fixes the problem. I've tested the patched code under > Windows/JDK1.3 and it seems to work fine there as well. However, this patch > should still be reviewed carefully. > > Joerg Henne > > ------------------------------------------------------------------------------ > Name: patch.diff > patch.diff Type: Plain Text (text/plain) > Encoding: 7bit > > Part 1.3Type: Plain Text (text/plain) --------------C2A17D679D4584456E924D60 Content-Type: text/plain; charset=us-ascii; name="patch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.diff" Index: src/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java =================================================================== RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java,v retrieving revision 1.5 diff -u -u -r1.5 XSLTProcessorImpl.java --- src/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java 2001/09/06 14:04:11 1.5 +++ src/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java 2001/09/12 17:37:40 @@ -337,7 +337,7 @@ else { File parent = new File(base.substring(5)); File parent2 = new File(parent.getParentFile(), href); - xslSource = resolver.resolve("file:/" + parent2.getAbsolutePath()); + xslSource = resolver.resolve(parent2.toURL().toExternalForm()); } } InputSource is = xslSource.getInputSource(); --------------C2A17D679D4584456E924D60 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org --------------C2A17D679D4584456E924D60--