Are you handing this off directly to FOP or running it through another XSL processor to produce the FO output? I use the same structure in the stylesheet used to generate the FO output. The XSL processor I have for my database doesn't speak FOP, so I use it to generate an FO stylesheet that is handed off to FOP. Yes, it is a two-step process. The first element in my FO stylesheet (after the XML declaration) is <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:edit="edit.uri">
My technique may not be the canonical method, but it works for me. Pete Allison Marshall Space Flight Center "The universal aptitude for ineptitude makes any human accomplishment an incredible miracle." - Air Force Col. John P Stapp, first person to sustain a 40g deceleration. _____ From: Patterson, Gregory Michael [mailto:grpat...@indiana.edu] Sent: Tuesday, December 16, 2008 3:16 PM To: fop-users@xmlgraphics.apache.org Subject: FOP XML->XSLT->FOP PDF Issues Hello, I'm having some trouble getting the FOP to properly use an xslt stylesheet. I am getting a ValidationException saying I need to put fo:root at the top. My first element is an xsl element, but the first fo: element is fo:root. This is exactly the same format as the examples in the fop examples packages. In my case, I need to pull the appropriate xsl from a database, and below is what I'm getting back: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="fo" version="1.1"> <xsl:output indent="yes" method="xml" omit-xml-declaration="no" version="1.0"/> <xsl:param name="versionParam" select="'1.0'"/> <!-- ========================= --> <!-- root element: projectteam --> <!-- ========================= --> <xsl:template match="projectteam"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> . . . Here is the error: (Location of error unknown)org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "", Local Name: "stylesheet") instead. Please make sure you're producing a valid XSL-FO document Finished. If you'll notice, the first fo element is fo:root, but I do have other things (required afaik) before it. Thanks in advance for any help. -Greg