views:

367

answers:

2

Hi, first of, I don't know much about XSL.

I am using a app called DITA to generate pdfs. One of the things it requires is an overwrite of an xsl file; to add custom styling.

I am trying to add an external graphic using a relative path. It doesn't work, unless I supply the full path.

Does not work:

<fo:block text-align="center" width="100%">
  <fo:external-graphic src="../../images/logo.png"/>
</fo:block>

Does work:

<fo:block text-align="center" width="100%">
  <fo:external-graphic src="/absolute/path/to/images/logo.png"/>
</fo:block>

I looked on the web, it said to use "file:image.png" and other website said to use "url(image.png)", but neither worked.

What am I doing wrong?

A: 

I'd say you've got a conflict between where you think you are and where the processing engine thinks it is. Absolute paths always work. Try to verify 'current' location and you'll see what's going on.

Liz Fraley
A: 

The path is relative to the location of the XML document, not the location of the stylesheet.

Frank