> -----Original Message----- > From: Ross Gardler [mailto:[EMAIL PROTECTED] > Sent: Sunday, 14 May 2006 4:58 AM > To: dev@forrest.apache.org > Subject: Re: [jira] Commented: (FOR-635) images not reproduced in PDFs, if > sources are in xdocs/images directory > > Gav.... wrote: > > > >>-----Original Message----- > >>From: Ross Gardler (JIRA) [mailto:[EMAIL PROTECTED] > >>Sent: Saturday, 13 May 2006 9:29 AM > >>To: dev@forrest.apache.org > >>Subject: [jira] Commented: (FOR-635) images not reproduced in PDFs, if > >>sources are in xdocs/images directory > >> > >> [ http://issues.apache.org/jira/browse/FOR- > >>635?page=comments#action_12383339 ] > >> > >>Ross Gardler commented on FOR-635: > >>---------------------------------- > >> > >>(some notes I'm working on about 3 issues at once due to Forrest Friday > >>and IRC - need this so we don't forget what we have discovered) > >> > >>Looking at http://localhost:8888/samples/sample.fo > >> > >>we see that an xdoc entry of: > >> > >><icon height="22" width="26" src="../images/icon.png" alt="feather"/> > > > > > > Why use ../ at all ? > > It's legacy, but that is not important, the key is that the URL works > for HTML but not for PDF. We need to standardise somewhere. Sure it > should be in the sources, but then we can't control the users sources. > If we can make the handling of URLs work regardless of the rubbish put > in by users then Forrest is a big hit with users. > > > The two images directories are static so this relevant from document > rubbish > > Is not needed. > > > > And, is ../images intended to be /resources/images or /xdocs/images ? > > Again, legacy. Images used to be in one location, then moved to another, > then to another etc. > > > There can also be ../../../images/icon.png if the nested directories are > > deep enough. In all nested or root cases specifying /images/icon.png > would > > Always work. Can we do away with dotdots ? > > Only if you are prepared to edit every single users source documents for > them ;-) > > Seriously, we can choose to only support images/icon.png and correct our > sources. But if we can it would be better if we handle all potential > user error - less work for us on the user lists. > > So how do we do it? > > How about stripping ay leading dotdots before we process image references?
Ok, so where is the best place to do this, in the document-to-fo.xsl file Or somewhere else? In document-to-fo.xsl we can use substring-before to detect for .. and remove It but can't see how to do it if there is more than one nested level. If there was ../../ for instance. I'll keep looking, I feel this issue needs doing before the release and so Will keep concentrating on this issue for now. Gav... > > > (NOTE we should still tidy up our example docs to conform to our "best > practice" recomendations) > > I don't think the idea of adding special matches for possible matches is > a good idea, that could be a never ending task. > > > Ross > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.392 / Virus Database: 268.5.6/338 - Release Date: 12/05/2006