Reputation: 135
I'm making a PDF from an XMl doc using XSL-FO. I need to import images using their names that are inside the XML doc.
Example XML:
<newAlbums>
<album cover="blaimage.jpg"/>
</newAlbums>
I need to do this through a similar statement:
<fo:external-graphic src="({})/>
What XPath do I need to put inside the src attribute to import the image? Thanks for the help this has been killing me.
Upvotes: 3
Views: 4132
Reputation: 9873
It will basically be <fo:external-graphic src="{concat('url(', /newAlbums/album/@cover, ')')}">
. The exact XPath expression will depend on your XML. For example, you will most likely have more than one album element, so /newAlbums/album[1]/@cover
or similar will be required.
Upvotes: 9