DITA PDF2 "external-graphic" reference

Here should go questions about transforming XML with XSLT and FOP.
jnielsen
Posts: 58
Joined: Fri Sep 12, 2008 12:12 am

DITA PDF2 "external-graphic" reference

Post by jnielsen »

Hello,

I am using Oxygen to transform DITA topics into PDF2 (Idiom plugin) and I have added the following code to the front-matter_1.0.xsl file:

Code: Select all


 <fo:block>
<fo:external-graphic src="/some/absolute/path/cis_logo.jpg"/>
</fo:block>
But I need the path to be relative not absolute. I am not sure if this is possible so I have tried rather utilizing an existing parameter such as <fo:external-graphic src="{$artworkPrefix}/cis_logo.jpg"/> and that seems to work okay except it does not point to the directory of my logo (the basedir), so I would like to pass another parameter to it from build.xml (in /DITA-OT/demo/fo), but am unsure of how to do this. Does anyone have any ideas how I can point to the logo in my basedir with a variable/parameter? Or should I consult the DITA yahoo users group?

Thanks,

Josh
Radu
Posts: 9472
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA PDF2 "external-graphic" reference

Post by Radu »

Hi Josh,

Ok, so first, as you explained on the DITA Users List you have to set a parameter for it in the "front-matter_1.0.xsl":
<xsl:param name="artworkPrefixPath"/>

Then you have to pass a value for the XSLT parameter from the build file.
Open the DITA-OT\demo\fo\build.xml file in Oxygen.
Add a new parameter at the start of the build file:
<property name="artworkPrefixPath"/>

Now search for the XSLT transformation which creates the FO file.
Search for the line:
<arg line='-o "${buildDir}/stage2.fo"'/>

and add at the end of the arguments list an argument like:
<arg line='"artworkPrefixPath=${artworkPrefixPath}"'/>

Then, open the DITA Map in Oxygen, edit a DITA to PDF transformation scenario, in the Parameters tab add a new Parameter called "artworkPrefixPath" with the desired value.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jnielsen
Posts: 58
Joined: Fri Sep 12, 2008 12:12 am

Re: DITA PDF2 "external-graphic" reference

Post by jnielsen »

Wow. How have I not noticed the feature to add new parameters to the transformations before? Has that always been there? Having a fixed number of parameters has been a problem in the past.

At any rate, thank you Radu for the response. I will try this shortly.
Post Reply