cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject URL Bug
Date Wed, 11 Jul 2001 18:44:25 GMT
I found out while debugging the XIncludeTransformer that the construct

new URL(baseUrl, relative);

does not return the expected results--esp. when dealing with "file"

if your baseUrl variable is set to "file:C:\pat\to\context\" (what happens
when you transform a "context" url through the factory first), when you
try to get a relative URL to that one you lose everything about the base

------------------- Example --------------------

URL baseUrl = new URL("file:C:\\path\\to\\context\\");
String relative = "index.xml";

URL newUrl = new URL(baseUrl, relative);


------------------- Results --------------------


--------------- Expected Results ---------------


--------------------- End ----------------------

I fixed the URLFactoryImpl class to work around this
with "file" protocol URLs.  This way the XIncludeTransformer
can work as expected.  I assume this is a bug in Sun's JVM,
but I am not the only one bitten by it.

Does anyone else have input on this?

Please note that the XIncludeTransformer's namespace has been
upgraded to the currently released spec as well.
View raw message