Platform compatibility issue
To further my work on the corpus PDF document, I've set up a local copy of the journal on my system. This has thrown up a couple of issues related to platform compatiblity. The main one is that the Cocoon realpath:/ protocol returns a path ending in a trailing slash on Linux, but on Windows there's no slash. This means (among other things) that images are not retrieved and used for PDF generation, because the path to the images folder is created based on realpath, and ends up lacking a slash.
Cross-platform compatibility is important for this project, so I need to solve this. These are some of the options:
- Instead of passing in a fully-constructed path from the sitemap to the XSLT transformation, pass in only the realpath variable. Then the XSLT can check for a trailing slash before building the full path by adding "
teiJournal/images". This means that part of the path to the images is hard-coded into the XSLT, which perhaps makes it harder to change. - Finding some way to check the value returned by
realpathinside the sitemap, and branching based on that. (I don't know of any way to do that, other than flowscript). - A modified version of #1, which would pass both realpath and the subsequent component (
teiJournal/imagesin our current setup), then having the XSLT combine the two to create the full path.
On balance, I think #3 is best because it allows for configuration within the sitemap, but platform flexibility through the XSLT.
This needs to be tested live on the server, though.