Did you read the links I included? Xslt does not contain fo. Xslt can include fo tags which would make it xslfo which can be transformed with an xml to generate fo. Xslt can be used without any fo tags to generate web content. FOP requires either xslfo + xml or fo which is that intermediate result of xslfo + xml you're seeing in the 2 step transformation. The difference between the xslt and xslfo is the fo tags which tell it how to generate a document, which provides information such as page breaks which you wouldn't have on the web. While your xslt file with the < tags in it did pass an xsl validation with one free program I found to verify syntax, it's not standard code to start a tag with < and end with >.
If you can break the code with variables I'd like to see a sample. I use plenty of variables in my xsl. If you cannot transform your xml+xslt->pdf with fop 1.0 with the < references converted to < please send what error message you're seeing. That works fine here. -----Original Message----- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 11:44 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, > I think you're a bit confused. Oh yes. > 1) FOP doesn't complain about anything. My response included the corrected > xslt along with a PDF I got from FOP with it. I'm not quite sure WHO exactly complains. The original xslt (with <) works fine if I use it to transform the xml file. It generates a fo-file which I can then transform into a pdf. The corrected xslt works fine, if I don't use more complex transformations. It stops working when I use variables. > 2) I'm not sure what you mean by "valid xml". Your xml file is a > valid xml. Your xslt file is not xslt if it contains any fo. If you fix the > tags it's valid xslfo. My xslt should not contain valid fo, it should create valid fo. If I fix the tags, it's (IMHO) no longer a valid xslt-file. > 3) Converting < to < wouldn't make it work any better as anything > else since you didn't convert > to > Converting < to < would make it a valid xslt-file, IMHO, since the fo-tags are no longer found. The transformation originally worked fine with fop 0.20, so it is possible that something changed, but that would still not explain why I can transform xml+xslt->fo and fo->pdf, but not xml+xslt->pdf directly. Regards Georg Datterl ------ Kontakt ------ Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH: www.irs-nbg.de Willmy PrintMedia GmbH: www.willmy.de Willmy Consult & Content GmbH: www.willmycc.de -----Ursprüngliche Nachricht----- Von: Eric Douglas [mailto:edoug...@blockhouse.com] Gesendet: Dienstag, 7. Dezember 2010 17:25 An: fop-users@xmlgraphics.apache.org Betreff: RE: ValidationException: Document is empty I think you're a bit confused. 1) FOP doesn't complain about anything. My response included the corrected xslt along with a PDF I got from FOP with it. 2) I'm not sure what you mean by "valid xml". Your xml file is a valid xml. Your xslt file is not xslt if it contains any fo. If you fix the tags it's valid xslfo. 3) Converting < to < wouldn't make it work any better as anything else since you didn't convert > to > Xslt: http://www.w3schools.com/xsl/default.asp Xslfo: http://www.w3schools.com/xslfo/default.asp Xslt was designed to format xml data for a web page. Xslfo expands on xslt to add the pageable tags required for a PDF which a web page wouldn't understand. -----Original Message----- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 10:40 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, You are right. But. Of course there's a but... Let me expand my transformation a little bit: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="A4_HEIGHT" select="'297mm'"/> <xsl:template match="ROOT"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="simple" page-height="</xsl:text> <xsl:value-of select="$A4_HEIGHT"/> <xsl:text disable-output-escaping="yes">" > <fo:region-body /> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="simple"> <fo:flow flow-name="xsl-region-body"> <fo:block></fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet> Now fop (actually: the sax parser) complains about the < in page-height. Quite understandable, I think. And the whole transformation is no longer valid xml, since the fo tags are mixed into the xsl tags. Regards, Georg Datterl ------ Kontakt ------ Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH: www.irs-nbg.de Willmy PrintMedia GmbH: www.willmy.de Willmy Consult & Content GmbH: www.willmycc.de -----Ursprüngliche Nachricht----- Von: Eric Douglas [mailto:edoug...@blockhouse.com] Gesendet: Dienstag, 7. Dezember 2010 16:21 An: fop-users@xmlgraphics.apache.org Betreff: RE: ValidationException: Document is empty That seems a strange thing to do but yes that works fine. FOP just doesn't like html in the xslt. Replace all < with < and you get an empty document. -----Original Message----- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 10:08 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi Eric, Indeed, the xml is nearly empty, but I'd expect a one-page document with one flow and one block inside. Regards, Georg Datterl ------ Kontakt ------ Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH: www.irs-nbg.de Willmy PrintMedia GmbH: www.willmy.de Willmy Consult & Content GmbH: www.willmycc.de -----Ursprüngliche Nachricht----- Von: Eric Douglas [mailto:edoug...@blockhouse.com] Gesendet: Dienstag, 7. Dezember 2010 16:05 An: fop-users@xmlgraphics.apache.org Betreff: RE: ValidationException: Document is empty That would be because your document is empty. Am I missing something here? This is the entire text of the xml you attached: <ROOT></ROOT> -----Original Message----- From: Georg Datterl [mailto:georg.datt...@geneon.de] Sent: Tuesday, December 07, 2010 9:30 AM To: fop-users@xmlgraphics.apache.org Subject: AW: ValidationException: Document is empty Hi everybody, Since nobody yet provided an answer, let's make it easier to debug. Here are a really short xml and a really short and simple transformation. The call to fop is org.apache.fop.cli.Main -d -xml test/xml/billing.xml -xsl test/xsl/billing.xslt -pdf c:\temp\test2.pdf Fop version is the latest trunk. Error message is: org.apache.fop.fo.ValidationException: Document is empty (something might be wrong with your XSLT stylesheet). Confused is: me. What could be wrong with my stylesheet? (Yes, I know we don't like xml and xslts here, but obviously I can't provide anything else) Regards, Georg Datterl ------ Kontakt ------ Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH: www.irs-nbg.de Willmy PrintMedia GmbH: www.willmy.de Willmy Consult & Content GmbH: www.willmycc.de -----Ursprüngliche Nachricht----- Von: Georg Datterl Gesendet: Freitag, 3. Dezember 2010 18:22 An: 'fop-users@xmlgraphics.apache.org' Betreff: ValidationException: Document is empty Hi folks, Another funny question from yours truly. It's been some time since our last quiz show and maybe this time we get a new winner. Anyway, here's todays problem: Given: * FOP 1.0, Batik 1.7, xmlgraphics-commons 1.4, xalan 2.7.1, xerxes 2.6.2, through maven, but I get the same results with a shortly-before-1.0-release version of trunk and XmlSpy * * A simple xml file * An equally simple transformation file, one page layout, a few blocks, two tables with blocks, two borders. Wanted: * A simple PDF, one page, no images. Problem: * When applying the transformation, I get a fo file which I can transform into a pdf. Everything works fine. * When running the xml and the xslt through fop (following ExampleXML2FO), I get the fo file which I can transform into PDF. Looks ok. * When running the xml and the xslt through fop (following ExampleXML2PDF) with MimeConstants.MIME_FOP_AREA_TREE, I get the area tree. Looks ok. * When running the xml and the xslt through fop (following ExampleXML2PDF) with MimeConstants.MIME_PDF, I get [org.apache.fop.fo.FOTreeBuilder] -> org.apache.fop.fo.ValidationException: Document is empty (something might be wrong with your XSLT stylesheet). * When combining ExampleXML2FO and ExampleXML2PDF and using two transformations (XML->FO, FO->Area tree), I get a correct Area tree. * When combining ExampleXML2FO and ExampleXML2PDF and using two transformations (XML->FO, FO->PDF), I get a pdf, which should have one PageSequence with one page, according to fop.getResults(). I can't open the PDF in Acrobat (pdf corrupt and can't be repaired) That's it. No error messages, no hints. Area tree works, generating a pdf does not. Generating a fo and then a pdf works in XmlSpy. Does anybody see any reasoning behind that? Regards, Georg Datterl ------ Kontakt ------ Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH: www.irs-nbg.de Willmy PrintMedia GmbH: www.willmy.de Willmy Consult & Content GmbH: www.willmycc.de --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org