On 04 Feb 2009, at 18:21, Kerry, Richard wrote:
Hi
<snip />
I notice that at the moment the filename value appears in the FO
file in the form "url(images/drft.png)" when I set
draft.watermark.image to "images/draft.png" in my custom xsl file.
Thus I presume that the stylesheet is just copying over the
parameter value and putting it in "url()".
Correct.
Can someone advise how to go about doing this. Do I need to tell
the XSL stylesheet to change the format of what it inserts in the
FO ? Or do I need to tell FOP that it's a URL/URI and to use the
resolver ?
Nothing special to do with the stylesheet, URIResolvers or
CatalogResolvers, IIC.
FOP recognizes 'url(images/draft.png)' as a relative URI, but will
resolve it using the current working directory as the base[*], unless
you use a configuration file when running FOP.
See also: http://xmlgraphics.apache.org/fop/0.95/configuration.html
In short: if you use the configuration to set the 'base' option, that
will be the base for all relative URIs encountered in the FO document.
If you would set it to 'file:///C:/DocBook/docbook-xsl-1.74.0/' then
you should get the same effect as specifying the absolute URI you
started with.
[*] Note: there is an open Bugzilla entry ( https://issues.apache.org/bugzilla/show_bug.cgi?id=46566
) concerning resolution of font URLs, where it is mentioned that it
would probably be better in line with the related RFC to use the base
URI of the document/config file. All well and easy if that actually
exists as a file somewhere. As soon as the XML only exists as a stream
or a LOB on a database, this will be next to impossible.
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]