I got to the bottom of the issue.

It's at least two-fold:

1. Bug in org.apache.cocoon.components.source.impl.ZipSourceFactory, on this 
line:
        // Get protocol. Protocol is configurable via cocoon.xconf
        final String protocol = location.substring(0, protocolEnd - 1);

Obviously it should be location.substring(0, protocolEnd). This is what causes 
zip to be truncated to "zi".

2. When using a SYSTEM identifier with relative DTD path, the XML parser will 
look for the file relative to the URI of the zipped source, 
zip:archive.zip!/source.xml which is obviously going to fail.

Here, the solution is to have the source implementation class (in this case 
org.apache.cocoon.components.source.impl.ZipSource) to change getURI method to 
return source.xml based on archive.zip location, w/o the zip protocol. Current 
implementation:

        return this.protocol + this.archive.getURI() + "!/" + this.filePath;

is not going to work. Something like this will:

        int iZipIdx = this.archive.getURI().lastIndexOf("/");
        if (iZipIdx < 0) iZipIdx = 0;
        return this.archive.getURI().substring(0,iZipIdx)+"/"+ this.filePath;


As I do not have a JIRA account, please feel free to confirm my findings and 
enter the bug into the system. 

Thanks for all your help! 

Leonid Geller


-----Original Message-----
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 10, 2007 12:21 PM
To: [email protected]
Subject: Re: File Generator and Compressed XML

Leonid Geller napisaƂ(a):
> I finally found the problem:
> 
> The zip source works on XML which does not declare a DTD.
> 
> The error (java.net.MalformedURLException: unknown protocol: zifile) is only 
> reported when using a doctype (fails with both relative and absolute URLs).
> 
> Any suggestions?

Only suggestion here is to take debugging session. It really must be
some obscure, little bug. Let me know if you are going to track the
problem down. I could have a look into this problem in a week.

Also create an issue on JIRA, please.

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to