AW: [xep-support] Problem with image-base-url and svg

From: <>
Date: Thu Mar 10 2005 - 05:19:44 PST

Hello Chris,

thank you for the hint, unfortunately it didn't help.

Below some code to show that system ids are set. The first part is the main
method that creates the pdf. It is worth to mention that the input xml is
created out of the aBordereauTO object and is never materialised in the
process and is just used to fire SAX events. The same holds true for the fo,
which just fires on the ContentHandler from xep/fop.

Thanks in advance for every help, even though I am quite near to give up on

Current setup:
XEP - XSL Formatting Engine for Paged Media

Version 4.2 build 20050228
February 28th, 2005

  Windows XP SP1

  java version "1.4.1_03"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
  Java HotSpot(TM) Client VM (build 1.4.1_03-b02, mixed mode)

Best regards, Werner

    BordereauXMLReader r = new BordereauXMLReader();
    Source bordereauSource =
      (Source)(new SAXSource(r, new BordereauSource(aBordereauTO,

    // Create the fo renderer, set a byte stream as result.
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ContentHandler foContentHandler = null;
    if(FOP_NOT_RENDERX == true)
      // Work with fop
      foContentHandler = this.getFopContentHandler(baos);
      // Work with xep
      foContentHandler = this.getXepContentHandler(env, baos);
    // Create the templates and the transformer
    Transformer transformer = null;
      Templates templates = this.getTemplates(env);
      transformer = templates.newTransformer();
    catch(TransformerConfigurationException tce)
      throw new RM90Exception(TRANSFORMER_CONFIGURATION_EXCEPTION, tce);
    catch(TransformerException te)
    // Place the fo renderer input handler on the output of the transformer
      SAXResult sr = new SAXResult(foContentHandler);
      transformer.transform(bordereauSource, sr);
    catch(TransformerException te)
      throw new RM90Exception(TRANSFORMER_EXCEPTION, te);
    // Create the DocumentWrapper
    DocumentWrapper result = new DocumentWrapper(DocumentType.BORDEREAU);
    result.setCreationDate(new Date());
    return result;


  private Templates getTemplates(Environment env) throws
TransformerConfigurationException, TransformerFactoryConfigurationError
    if(m_templates == null)
      TransformerFactory tf = TransformerFactory.newInstance();
      BordereauResolver aResolver = new
      Source stylesheet = null;
        stylesheet =
aResolver.resolve(BordereauResolver.STYLESHEET_ROOT_FILE_NAME, null);
      catch(TransformerException te)
        throw new TransformerConfigurationException("Trouble retrieving the
stylesheets", te);
      m_templates = tf.newTemplates(stylesheet);
    return m_templates;

  private ContentHandler getFopContentHandler(ByteArrayOutputStream baos)
    Driver d = new Driver();
    Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_DISABLED);
    return d.getContentHandler();
  private ContentHandler getXepContentHandler(Environment env,
ByteArrayOutputStream baos)
    throws RM90Exception
    ContentHandler result = null;
    StreamSource config = new StreamSource(
      if(this.m_xepFormatter == null)
        Properties p = new Properties();
        this.m_xepFormatter =
          new FormatterImpl(config, p,

      result = this.m_xepFormatter.createContentHandler(
          BordereauResolver.INPUT_FILE_NAME, new FOTarget(baos, "PDF"));
    catch(ConfigurationException ce)
N, ce);
      throw new RM90Exception(XEP_CONFIGURATION_EXCEPTION, ce);
    return result;

-----Ursprüngliche Nachricht-----
Von: [] Im
Auftrag von Chris Bowditch
Gesendet: Donnerstag, 10. März 2005 12:17
Betreff: Re: [xep-support] Problem with image-base-url and svg wrote:

> I have a problem with a message indicating a missing image-base-url,
> see also the small excerpt of the stack trace below.
> Caused by: com.renderx.xep.lib.InternalException: attribute
> 'image-base-url' is required but missing
> at com.renderx.xep.pre.AttList.getDefault(Unknown Source)
> I followed the advice I found scatterd in the mail list and assigned
> everywhere in my process system ids to stylesheets , sources and
> results if possible and sometimes even xml:base attributes, even
> though the only external graphic that needs to be loaded was
> referenced with an absolute path. After some fooling around, I found
> out that it was not the external graphic, that causes the trouble, but
> a <fo:instream-foreign-object> which carries an svg graphic. The svg
> graphic is a barcode created by your barcode library code128.xslt, and
> removing the svg from the fo resolves the missing image-base-url
> problem along with removing the barcode. So I guess, I have to set
> somewhere something on this svg object. Putting an xml:base on the
> element svg didn't help, so I need some help.

I encountered the same problem, but setting systemId on the SAXSource object

thats passed to formatterImpl.render method fixed the problem. If you are
already doing this then it might be worth upgrading to 4.2.


(*) To unsubscribe, send a message with words 'unsubscribe xep-support' in
the body of the message to from the address you are
subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
Received on Thu Mar 10 06:18:06 2005

This archive was generated by hypermail 2.1.8 : Thu Mar 10 2005 - 06:18:06 PST