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: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | 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: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]