Hi Thorsten, The PDF of this file is generated correctly when I place the new fo.xsl file in {properties:skins-dir}{forrest:forrest.skin}/xslt/fo/document2fo.xsl, so I know there is nothing wrong with it. When I place this file in {project:resources.stylesheets}/myNewFile2fo.xsl, and add the following to sitemap.xmap I get a "BROKEN: org.apache.fop.apps.FOPException: No flow in page-sequence" error (see attached error.log):
<map:match pattern="**aNewFile.pdf"> <map:generate src="{project:content.xdocs}{1}aNewFile.xml" /> <map:transform src="{project:resources.stylesheets}/myNewFile2fo.xsl" /> <map:serialize type="fo2pdf" /> </map:match> Looking at the .fo file, it seems that tables are not being assembled correctly: <fo:block background-color="#ffffff"> <fo:table-row border-color="#ffffff" border-width="1mm" border-style="solid"> <fo:table-cell border-color="#ffffff" border-width="0.5pt" border-style="solid" text-align="center" background-color="#0071b9" font-weight="bold" color="#FFFFFF" margin-end="4pt" padding-after="3pt" padding-before="5pt" padding-end="2pt"> <fo:block font-size="8pt" text-align="end">Version:</fo:block> </fo:table-cell> ... For some reason, the <fo:table> and <fo:table-body> elements are being omitted. Is this why the "No flow in page-sequence" error is generated? Thanks for your continued help, Steve -----Original Message----- From: Thorsten Scherler [mailto:[EMAIL PROTECTED] Sent: 16 January 2007 08:11 To: user@forrest.apache.org Subject: RE: How do I add a custom fo.xsl On Mon, 2007-01-15 at 18:31 +0000, Steve Odlind wrote: > Hi Thorsten, > > If I understand your suggestion correctly, ALL files in my site will use > the fo.xsl in the > {properties:skins-dir}{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl > directory. Is that correct? Yes. > If so, that's not quite what I wanted. I > would like just a few specified files to use the new fo.xsl. > Ok, I understand. Thanks for clarification. > >> Hmm, not sure there is a space! {1} aNewFile.pdf That could cause the > >>error. > > The space was a typo in the email, and not present in the source file. > Sorry for the confusion. No worries, just thought to point it out. > > >> We would need some more information (stack trace) to see where the > NPE > >>is coming from. > > Please find the stack trace attached. FATAL_E (2007-01-15) 18:12.18:658 [core.xslt-processor] (Unknown-URI) Unknown-thread/TraxErrorHandler: Error in TraxTransformer: file:/C:/docs/documentation/src/documentation/skins/pelt/xslt/fo/documen t2fo.xsl; Line 50; Column 59; ; SystemID: file:/C:/docs/documentation/src/documentation/skins/pelt/xslt/fo/documen t2fo.xsl; Line#: 50; Column#: 59 javax.xml.transform.TransformerException: java.lang.NullPointerException As I understand it the file file:/C:/docs/documentation/src/documentation/skins/pelt/xslt/fo/documen t2fo.xsl is throwing an exception at Line#: 50; Column#: 59. Makes me wonder what that might be. I looked at your original mail again: On Mon, 2007-01-15 at 15:45 +0000, Steve Odlind wrote: > <map:match pattern="**aNewFile.xml"> > <map:generate src="{project:content.xdocs}{1} aNewFile.pdf" /> > <map:transform src="{project:resources}/myNewFile2fo.xsl" /> > <map:serialize type="fo2pdf" /> > </map:match> The generator url is not valid (if you go with file naming conventions). You are trying to generate SAX events from a binary file ({project:content.xdocs}{1}aNewFile.pdf). I think you want {project:content.xdocs}{1}aNewFile.xml and then e.g. request http://localhost:8888/index-aNewFile.pdf. This would then trigger your custom match with the file {project:content.xdocs}index-aNewFile.xml. Then you need to change it to something like: <map:match pattern="**aNewFile.pdf"> <map:generate src="{project:content.xdocs}{1}aNewFile.xml" /> <map:transform src="{project:resources}/myNewFile2fo.xsl" /> <map:serialize type="fo2pdf" /> </map:match> That should work fine. Please try and report back. HTH salu2
error.log
Description: error.log