Return-Path: X-Original-To: apmail-xmlgraphics-fop-users-archive@www.apache.org Delivered-To: apmail-xmlgraphics-fop-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ABD7F9980 for ; Tue, 25 Oct 2011 09:09:39 +0000 (UTC) Received: (qmail 9484 invoked by uid 500); 25 Oct 2011 09:09:39 -0000 Delivered-To: apmail-xmlgraphics-fop-users-archive@xmlgraphics.apache.org Received: (qmail 9353 invoked by uid 500); 25 Oct 2011 09:09:38 -0000 Mailing-List: contact fop-users-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: fop-users@xmlgraphics.apache.org Delivered-To: mailing list fop-users@xmlgraphics.apache.org Received: (qmail 9345 invoked by uid 99); 25 Oct 2011 09:09:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Oct 2011 09:09:37 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of noloader@gmail.com designates 209.85.220.182 as permitted sender) Received: from [209.85.220.182] (HELO mail-vx0-f182.google.com) (209.85.220.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Oct 2011 09:09:32 +0000 Received: by vcbfo13 with SMTP id fo13so378939vcb.27 for ; Tue, 25 Oct 2011 02:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=2p88b1r1/70t+xazOA7gmtgBE0Sx8yNwlsCUytyBLPI=; b=wMhBRrSf3lqOj7NrY+bXvLydSmbD70Y404EQRAMSeGSCVnSBKucMPnt2wdnjUCdK5Y Dq8YjvWmd8Q7SHq/I9hmsfRlx8CbNdJ9hko5U0p0aNR2XbnHAzL7JuZ+286ueaehqL9F HEV6FnLDoMZNi/mYPimMIe9i7GabnfBfKUmc0= MIME-Version: 1.0 Received: by 10.52.25.75 with SMTP id a11mr26706706vdg.1.1319533751419; Tue, 25 Oct 2011 02:09:11 -0700 (PDT) Received: by 10.220.1.138 with HTTP; Tue, 25 Oct 2011 02:09:11 -0700 (PDT) Reply-To: noloader@gmail.com In-Reply-To: <1364664807.2126076.1319531665940.JavaMail.fmail@mwmweb032> References: <1364664807.2126076.1319531665940.JavaMail.fmail@mwmweb032> Date: Tue, 25 Oct 2011 05:09:11 -0400 Message-ID: Subject: Re: Default XSL Stylesheet for PDF? From: Jeffrey Walton To: flattr.tomschr@online.ms Cc: fop-users@xmlgraphics.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 25, 2011 at 4:34 AM, wrote: > Hi Jeffrey, > > p, li { white-space: pre-wrap; } > On Tuesday 25 October 2011 Jeffrey Walton wrote: >> [...] >> > If you were curious the -xml input is used in conjunction with an XSLT >> > (thus the -xsl parameter) to transform said XML file to FO. There is >> > no "default" PDF stylesheet, this mechanism is merely a helper since a >> > lot of users create FO using a transform. >> >> OK. xalan also complains about a style sheet. These style sheets seem >> important. > > They are not important, they are essential! :-) OK. Dumb user question: if they are so important, why does the tool have no default style sheet to use? I would expect it to set margins at 1.00 inch (or 2 centimeters), etc. > 1. Validate your DocBook XML file first > Do NOT skip this step! Use xmllint and run it like this: > $ xmllint --xinclude --postvalid --noout book.xml > If you encounter any problems, fix it. DO NOT processed further if you > encounter any errors. The other steps rely on a valid DocBook source. > > 2. Transform your DocBook XML file into FO > The FO file is an intermediate file which is read by your FO formatter. > I've already wrote about how to run xsltproc. See lines above. OK, thanks. I was not aware this was a multi-step process. > 3. Format the FO file > Now you take your FO file and feed it into the FO formatter: > $ fop book.fo book.pdf OK. See below :( $ xmllint --xinclude --postvalid --noout book.xml # No complaints $ xsltproc --xinclude http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl book.xml > book.fo # No complaints $ fop -fo book.fo -pdf book.pdf # All hell breaks loose Thanks for the help. It is greatly appreciated. Jeff Oct 25, 2011 5:07:37 AM org.apache.fop.cli.Main startFOP SEVERE: Exception org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: Error: 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. javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Error: 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. at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197) Caused by: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Error: 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. at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214) ... 3 more Caused by: org.apache.fop.fo.ValidationException: Error: 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. at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:262) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163) at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485) ... 4 more --------- javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Error: 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. at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197) Caused by: org.apache.fop.fo.ValidationException: Error: 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. at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:262) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163) at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485) ... 4 more --------- org.apache.fop.fo.ValidationException: Error: 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. at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:262) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163) at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197) $ --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org