0

I've created an XSL-FO template using Oracle BI Publisher Add-in for Microsoft Word and I would like to transform it using FOP, and export it to PDF file.

Transform action fails after spotting the first tag from the Oracle's namespace and the error message says:

(Location of error unknown)org.apache.fop.fo.ValidationException: Invalid property encountered on "fo:root": xdofo:nf-separator (No context info available)

Here's the code:

FopFactory fopFactory = FopFactory.newInstance();
out = new BufferedOutputStream(new FileOutputStream(new File("result.pdf")));
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);

StreamSource source = new StreamSource(generateOrderInvoiceXml(orderId));
StreamSource transformSource = new StreamSource(new File("template.xsl"));

TransformerFactory factory = TransformerFactory.newInstance();

Transformer transformer = factory.newTransformer(transformSource);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(source, res);

Is there a way to transform such template using FOP?

rpozarickij
  • 1,477
  • 3
  • 14
  • 27
  • You cannot use Oracle-specific properties. Anything with a prefix like `xdofo:` is unknown to FOP and must be removed from template.xsl. – mzjn Jul 17 '13 at 09:59

1 Answers1

0

To prevent FOP from choking on unknown proprietary properties, disable strict validation:

fopFactory.setStrictValidation(false);

Reference: http://xmlgraphics.apache.org/fop/1.1/embedding.html#fop-factory.

mzjn
  • 48,958
  • 13
  • 128
  • 248