try {
URL baseURL = new URL(getUserAgent().getBaseURL() == null
? new java.io.File("").toURL().toExternalForm()
: getUserAgent().getBaseURL());
if (baseURL != null) {
SVGOMDocument svgdoc = (SVGOMDocument)doc;
svgdoc.setURLObject(baseURL);
//The following line should not be called to leave FOP compatible to Batik 1.6.
//svgdoc.setDocumentURI(baseURL.toString());
}
} catch (Exception e) {
log.error("Could not set base URL for svg", e);