OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] XML catalogs, images and PDF


we've just started to translate our manuals, and we use entities to deal with images. Our images are stored in two directories: <main-dir>/<language>/images and <main-dir>/images. The first one contains the localized images, the second one the language-independent ones. When referencing the images in the XML sources, the path includes an entity: fileref="&images;/my-localized-image.png", or fileref="&common-images;/my-nonlocalized-image.png". The entities are defined in a common entity file that is referenced in every XML file. &common-images; points to <main-dir>/images, &images; points to the local images directory.

That way we had to modify our source XMLs only once, when we decided which images will be translated.




On 09/21/2012 02:50 PM, Ola Widin wrote:

Hi there,

Is there anybody out there who has managed to get an XSL-FO renderer to resolve
image file locations using XML catalogs (or using any other neat trick)?

I have struggled with this for some time now but not managed to come up with a
working solution, and I'm starting to believe that it is not my XML-fu that is
limited, but that it is actually not possible with the tools I've used.

More specifically:
We have a manual that consists of several XML files containing the chapters, and
a main XML file that just uses XInclude to "collect" the chapters. All XML files
are located in the same folder (in this case called "en/"). In this folder,
there is also an "images" folder that contains all the images included in the
manual (using <imagedata fileref="images/image_file_name.pdf"). Generating a PDF
for the manual works fine, as long as all referred images are present in the
"images" folder.

When we translate the manual we send all the (english) XML files to the
translators, and for each language we get back a set of XML files with the
"readable" content translated but everything else unchanged - file names, xml:id
attributes, and fileref attributes for images. The images seldom contains
anything that needs to be translated, and if they do we take care of that
ourselves. When generating PDF:s for the translated manuals, we currently have
to copy the entire "images" folder from the "en" folder to each folder with the
translated manuals, and then make sure that we correctly replace the few
translated images.

Now, what I hoped would be possible with XML catalogs was to get the XSL-FO
renderer to look for the images in multiple locations:
- First look in the "images" folder in the folder with the current XML files
- if the image file was not found there, look in the "en/images" folder

This way we would not have to fill the "images" folder for each translation with
identical copies of the un-translated images, and instead keep only one copy in
the "en/images" folder. It would also be easier to check that all images that
need translation are actually translated, since the "images" folder for the
translated manual would only contain translated images.

So far I have tried using both XEP (that we currently use for generating PDFs)
and FOP (as an experiment), and xsltproc, Saxon (6.5.5) and Xalan for generating
the FO files, but nothing has worked for me. I must have tried every trick I
could find on the interwebs on how to get these tools to resolve using XML
catalogs, but have this far only managed to get xsltproc to resolve the
XIncludes in the main XML file (but never Saxon or Xalan).

Best Regards

Ola Widin

*Kanin Design Information & Interaktion*
Phone: +46 (0) 709-37 86 10
E-mail: ola@kanindesign.se <mailto:ola@kanindesign.se>

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]