[xep-support] error rendering with DOM-Document

Michael Smith msmith at speedlegal.com
Sun Feb 6 15:20:28 PST 2005


Kurt Spescha wrote:
> Hi,
> 
> using the rendering method passing org.w3c.dom.Document
> 
> public void write(FoDocument foDocument, OutputStream pdfStream) throws
> Exception {
>         com.renderx.xep.gen.backends.H4PDF printer = new
> com.renderx.xep.gen.backends.H4PDF(pdfStream);
>         com.renderx.xep.Driver.render(foDocument.getDocument(),
> printer);
>         com.renderx.xep.Driver.cleanup();
> }
> 
> causes an error after validating OK (see below). I can't see where the
> problem can be. (for the FO see attachment)
> 
> 2005-02-04 11:43:55.723000000 - [system-id untitled](validate
> [validation OK])(compile 
> {?Invalid element in anonymous namespace: 'fo:root'; element skipped}
> )(format )(generate [output-format pdf]))

 From this error message, I'd guess that you've parsed your XML into a 
DOM Document using a parser which a) doesn't support namespaces, or b) 
has namespace support turned off (most likely the latter).

This would (I'd guess) mean that the parser would see no namespaces at 
all (hence 'anonymous namespace') and an element called 'fo:root'. An 
XSL:FO document is required to have a root element called 'root' in the 
appropriate (non-anonymous) namespace.

I haven't tested this, but it looks pretty plausible.

Mike
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



More information about the Xep-support mailing list