You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2001/06/13 06:24:49 UTC

[Bug 2142] New: - XInclude can not work

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

*** shadow/2142	Tue Jun 12 21:24:49 2001
--- shadow/2142.tmp.13029	Tue Jun 12 21:24:49 2001
***************
*** 0 ****
--- 1,39 ----
+ +============================================================================+
+ | XInclude can not work                                                      |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2142                        Product: Cocoon 2                |
+ |       Status: NEW                         Version: 2.0alpha CVS            |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Critical                 OS/Version: Windows NT/2K           |
+ |     Priority: Other                     Component: core                    |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: cocoon-dev@xml.apache.org                                    |
+ |  Reported By: wangtun@staff.yam.com                                        |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ I use XInclude including the file 'include.xml' in the file 'text.xml' such as:
+ <xi:include href="include.xml" parse="xml"/>.
+ It can not work.
+ 
+ In log file, it logged the 'include.xml' be transleted to a wrong 
+ url: 'file:/..../cocoon/test.xmlinclude.xml'. I found out the bug in the class 
+ org.apache.cocoon.components.url.URLFactoryImpl:
+ public URL getURL(URL base, String location) throws MalformedURLException {
+         if ( base != null ) {
+             return getURL(base.toExternalForm() + location);
+         } else {
+             return getURL(location);
+         }
+     }
+ 
+ I fixed it as following:
+ public URL getURL(URL base, String location) throws MalformedURLException {
+         if ( base != null ) {
+             return getURL(new URL(base, location).toExternalForm());
+         } else {
+             return getURL(location);
+         }
+     }
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org