forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: Adding protocols to links
Date Tue, 10 Dec 2002 19:57:00 GMT
Jeff Turner wrote:
> Hi,
> Seems the commonest complaints about Forrest are to do with linking..
> a) How do I link to an existing static file, like a PDF?
> b) How to I link to not-yet-generated stuff like Javadocs without getting
> errors.
> Doing a bit more thinking about it..
> <link> elements contain URI pointers.  URIs always have a protocol (aka
> scheme); http:, ftp:, file:, urn: etc.
> For Forrest, the implied protocol in relative hrefs is 'cocoon:'.  So
> <link href="mypdf.pdf"> actually means <link href="cocoon:mypdf.pdf">.
> For people trying to link to a static mypdf.pdf, or a nonexistent
> apidocs/ directory, or a file that will be created by a non-Forrest app,
> this is no good.
> So I think users should be able to specify protocols other than
> 'cocoon:', to say to Cocoon, "don't touch, this isn't your business", and
> correspondingly, say to Forrest, "process this some other way".
> So how about the following solution:
> When encountering a file: link like <link href="file:foo.pdf">, Cocoon
> will:
>  - Rewrite the link to <a href="foo.pdf"> in document2html.xsl
>  - Not traverse the link (ie, filterlinks.xsl ignores file: links)
>  - Record the link in a file, say, unprocessed-files.txt
> After Cocoon has finished, then opens
> unprocessed-files.txt, and copies the listed files into build/site.
> I have this system working locally.  Eg, I have
> src/documentation/content/hello.pdf, and can link to it with <link
> href="file:hello.pdf">.  This works for webapp and command-line.
> Can I check this stuff in, or did anyone else have a brilliant solution
> to this problem up their sleeve?

The link crawling cocoon subsystem already recognizes the xlink:role 

As for now, if you declare something as xlink:role="dynamic" it will be 
skipped from the lists of the "link" view of that resource.

You might want to further enhance that.

In any case, I think that using attributes is a much better thing to do 
instead of messing up with the URI, because it will keep orthogonality 
no matter URI you get.

Stefano Mazzocchi                               <>

View raw message