Hi Ola,
I have configured XEP to use an XML catalog, not for image locations but to use 
a local SVG DTD when processing images that reference such a DTD.  I edited the 
xep.bat batch file (I'm running on Windows) to add two items to the java 
CLASSPATH:

resolver.jar
directory containing the CatalogManager.properties file, that points to an xml 
catalog file.

Then you add these options to the java command line in that file:

-Dcom.renderx.sax.entityresolver=org.apache.xml.resolver.tools.CatalogResolver 
-Dcom.renderx.jaxp.uriresolver=org.apache.resolver.tools.CatalogResolver

When first setting up a catalog, I usually set verbosity=4 in the 
CatalogManager.properties file so I can see how the catalog file is being used 
during the process.  Then set it back to 1 when everything is working.

Bob Stayton
Sagehill Enterprises
b...@sagehill.net


From: Ola Widin 
Sent: Friday, September 21, 2012 5:50 AM
To: docbook-apps@lists.oasis-open.org 
Subject: [docbook-apps] XML catalogs, images and PDF


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


---
Ola Widin


Kanin Design Information & Interaktion
Phone: +46 (0) 709-37 86 10
E-mail: o...@kanindesign.se





Reply via email to