Generating PDF from XML in Java using ApacheFOP

jonbehd

New Member
I am trying to generate on-the-fly PDF reports from Java objects. I have not been able to find many examples of this, so I have been following this example:http://svn.apache.org/viewvc/xmlgra...ava/embedding/ExampleObj2PDF.java?view=markupThe only real difference between this code and my own is that I generate src (line 81 in the example) using JSON conversion and an XMLSerializer.The problem I run into is using the Transformer. When I do the transform (line 87 of the example), I receive the error message:\[quote\] \[code\](Location of error unknown)org.apache.fop.fo.ValidationException: First element must be the fo:root formatting object. Found (Namespace URI: "", Local Name: "html") instead. Please make sure you're producing a valid XSL-FO document.\[/code\]\[/quote\]Since I don't have visibility into the Transformer, and haven't been able to find the kind of documentation to tell me how it is supposed to work, I don't really know where the transformation is breaking down.Any experience with this kind of conversion, or understand of whatever it is I'm missing is greatly appreciated.
 
Back
Top