Re: multi page-sequence don't work for (XML+XSL) to PDF on the fly
Hi, Can't you use multiple page-sequences instead of just creating one sequence 'interrupted' by the 'ctrlPage' template? but How? this template is more difficult since it is used in with a more complicated XML like .., the way that I sent is for brevety to discover because ctrlPage don't work, for groups I need print a header, followed by products, etc..., in original XSL i use xalan extensions to count how many lines I used PDF. A few remarks to help you on your way: 1. I can't seem to find the reason why you are placing the whole into a separate template, since it is ... well, static and it doesn't rely on the elements in the XML (unless something is missing). because, I reduced the code for brevety, then the static-content is for groups case. sorry 2. In the ctrlPage template, you are testing for a position(): you could also use XPath to select these, like to grab the two preceding product nodes. but for-each select don't put Xalan in DOM process? consumes more memory? however I can't use position because the original XML is more complex. (I use xalan extensions to control this). like this 3. Check our http://xml.apache.org/fop/resources.html page, among the books and articles, there's a link to Dave Pawson's XSLT FAQ. Over there, you'll find a lot of useful stuff (amongst others on grouping which I think you'll find particularly helpful), so I'll bet you can work out a redesign which affects only the XSL itself and leaves the other files alone. If you really can't get any further, try posting your problem on Mulberry's XSLT list. Warning: it's a quite high-traffic list, but the upside is that the tips are 'highly-usable' ;) Hope this helps! Cheers, Andreas Thanks for tips Clovis
RE: multi page-sequence don't work for (XML+XSL) to PDF on the fly
> -Original Message- > From: Clovis Wichoski [mailto:[EMAIL PROTECTED] > > But with multiple pages like 500 pages the redesign must be in XML > source, that need redesign in all XSL too (HTML, PDF, TXT and many > others), this cause a rework that I attempted to avoid, and only needed > because FOP throubles with memory, this is only a relief. > Hi, Can't you use multiple page-sequences instead of just creating one sequence 'interrupted' by the 'ctrlPage' template? A few remarks to help you on your way: 1. I can't seem to find the reason why you are placing the whole into a separate template, since it is ... well, static and it doesn't rely on the elements in the XML (unless something is missing). 2. In the ctrlPage template, you are testing for a position(): you could also use XPath to select these, like to grab the two preceding product nodes. 3. Check our http://xml.apache.org/fop/resources.html page, among the books and articles, there's a link to Dave Pawson's XSLT FAQ. Over there, you'll find a lot of useful stuff (amongst others on grouping which I think you'll find particularly helpful), so I'll bet you can work out a redesign which affects only the XSL itself and leaves the other files alone. If you really can't get any further, try posting your problem on Mulberry's XSLT list. Warning: it's a quite high-traffic list, but the upside is that the tips are 'highly-usable' ;) Hope this helps! Cheers, Andreas
Re: multi page-sequence don't work for (XML+XSL) to PDF on the fly
This is just a guess, but perhaps you could do a pre-pass using XSL to generate multiple output pages, and then use something like iText[1] to concatenate your output files together. FOP Resources: http://xml.apache.org/fop/resources.html I hope this helps! Web Maestro Clay On Jan 9, 2004, at 10:45 AM, Clóvis Wichoski wrote: Chris Bowditch wrote: Opening and closing XML tags within different XSL templates is bad practice. You'll need to redesign your XSL stylesheet or run the XSL Transform as a separate process, serialize the resulting FO and then present the FO to FOP. But with multiple pages like 500 pages the redesign must be in XML source, that need redesign in all XSL too (HTML, PDF, TXT and many others), this cause a rework that I attempted to avoid, and only needed because FOP throubles with memory, this is only a relief. Thanks for all reply Clovis
Re: multi page-sequence don't work for (XML+XSL) to PDF on the fly
Chris Bowditch wrote: Opening and closing XML tags within different XSL templates is bad practice. You'll need to redesign your XSL stylesheet or run the XSL Transform as a separate process, serialize the resulting FO and then present the FO to FOP. But with multiple pages like 500 pages the redesign must be in XML source, that need redesign in all XSL too (HTML, PDF, TXT and many others), this cause a rework that I attempted to avoid, and only needed because FOP throubles with memory, this is only a relief. Thanks for all reply Clovis
Re: multi page-sequence don't work for (XML+XSL) to PDF on the fly
Clóvis Wichoski wrote: The CDATA is only to maintain the XSL well-formed, since I close fo:flow on another template, Opening and closing XML tags within different XSL templates is bad practice. You'll need to redesign your XSL stylesheet or run the XSL Transform as a separate process, serialize the resulting FO and then present the FO to FOP. the tech is good, maybe dev team implement a SAX over the stream from XML+XSL transformation option, this is the feature that I mean. This isnt very clear, but if you mean serializing the result of the XSL transform before processing the FO then I wouldnt see this as a desirable feature for FOP. Mainly because it will slow down processing. If users require this functionality then they can implement it themselves very easily as I suggested above. Note that this is to reduce memory consuption. Chris
Re: multi page-sequence don't work for (XML+XSL) to PDF on the fly
Hi Jeremias, The CDATA is only to maintain the XSL well-formed, since I close fo:flow on another template, the tech is good, maybe dev team implement a SAX over the stream from XML+XSL transformation option, this is the feature that I mean. Note that this is to reduce memory consuption. Best regards Clovis Jeremias Maerki wrote: On 09.01.2004 18:29:14 Clóvis Wichoski wrote: The problem is that you put some XML code into a CDATA section. On-the-fly processing works with SAX. And in SAX your code will be delivered as text instead of as elements. I can't understand because on the fly don't woks and from .fo file generated from xml+xsl transformation work, maybe a bug of FOP, or I can't generate XML elements using CDATA from this form. The latter. I post this in dev list because I think that this is a feature or a bug on FOP then I attached the XSL and XML files that the team can test this issue, and the code is better to read than my bad English ;) Well, bad luck. Your issue would have been a better fit for fop-user. Jeremias Maerki
Re: multi page-sequence don't work for (XML+XSL) to PDF on the fly
On 09.01.2004 18:29:14 Clóvis Wichoski wrote: > > > disable-output-escaping="yes"> > > > > The problem is that you put some XML code into a CDATA section. On-the-fly processing works with SAX. And in SAX your code will be delivered as text instead of as elements. > I can't understand because on the fly don't woks and from .fo file > generated from xml+xsl transformation work, maybe a bug of FOP, or I > can't generate XML elements using CDATA from this form. The latter. > I post this in dev list because I think that this is a feature or a bug > on FOP then I attached the XSL and XML files that the team can test this > issue, and the code is better to read than my bad English ;) Well, bad luck. Your issue would have been a better fit for fop-user. Jeremias Maerki
multi page-sequence don't work for (XML+XSL) to PDF on the fly
Hi FOP DevTeam, I developed a way to generate multiple page-sequence on XSL without to change my XML, but the XML-XSL-PDF don't work, to make this work, first I need to generate the .fo file, then transform this to PDF. if run: fop.sh -xml sample.xml -xsl multiplePageSequence.xsl -pdf sample.pdf I get follow output: [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser [INFO] FOP 0.20.5 [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser [INFO] building formatting object tree [INFO] setting up fonts [ERROR] org.apache.fop.apps.FOPException: flow must be child of page-sequence, not fo:flow but if I first generate the .fo file with: xalan.sh -IN sample.xml -XSL multiplePageSequence.xsl -OUT sample.fo then generate the .pdf file from .fo file with: fop.sh -fo sample.fo -pdf sample.pdf I get the follow output: [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser [INFO] FOP 0.20.5 [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser [INFO] building formatting object tree [INFO] setting up fonts [INFO] [1] [INFO] [2] [INFO] [3] [INFO] [4] [INFO] Parsing of document complete, stopping renderer The part of XSL that cause on the fly transformation to catch the ERROR is: to close and open fo:flow and fo:page-sequence for I can't understand because on the fly don't woks and from .fo file generated from xml+xsl transformation work, maybe a bug of FOP, or I can't generate XML elements using CDATA from this form. I post this in dev list because I think that this is a feature or a bug on FOP then I attached the XSL and XML files that the team can test this issue, and the code is better to read than my bad English ;) Thanks for any help or tip Clovis http://www.w3.org/1999/XSL/Format"; xmlns:xsl="http://www.w3.org/1999/XSL/Transform";> http://www.w3.org/1999/XSL/Format";> HEADER CEL 1 HEADER CEL 2 HEADER CEL 3 A Sample report
XML-XSL to PDF
> Hello > > I´m new visitors. I need tranformer a file XML to PDF, but I don´t how do > that. > I take libraries XALAN.jar, FOP.jar and XERCES.jar and server with TomCat > 4.0.1 > > Please, help me > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]