Search code examples
xmlxsltxsl-foapache-fop

Relative path for external graphic with parameters


I'm having a problem constructing the links for my external graphics. In my xml for example I have this path: /images/1.png.

Now I want to print all the images from the xml in a for-each. But I don't know how to construct the following with a value from the current node:

url('resources/pdf/images/1.png')

The resources/pdf part is not in the xml.


Solution

  • put 'resources/pdf' in a parameter (e.g. Path) and use the concat method:

      <fo:external-graphic  src="url({$Path}/{../../PublicationElement/Document/DocumentURL})" scaling="non-uniform"/>