Detecting page breaks (Was Re: Creating FO DOM directly)
Shubhrata Tewari wrote: Hi, Greetings. Be careful not to hijack threads (i.e., remember to change the subject title in your email to help with searching the mailing list archives.) Is it possible using xslt and xsl:fo to detect a page break? No, not XSLT (xsl: namespace) because that happens before FOP starts working. FOP determines page breaks after the XSLT transformations are complete. As for XSL-FO (fo: namespace)... basically I am using a for-each, and I want to show some data in the first row of a page whenever a new page begins. Any ideas? Again, your xsl:for-each has dissolved and disappeared before FOP ever activates. If the data is constant ("Hi! Welcome to India!") then just place it in the fo:static-content with region xsl-region-start. If the data is dynamic and based on the contents of the page (for example, the first and last words on the page of a glossary or dictionary) then the fo:marker and fo:retrieve-marker is what you will need. Google on those two fo's for countless examples. If you would like running subtotals of financial data, Joerg gave a solution[1] a while back. Glen [1] http://marc.theaimsgroup.com/?l=fop-user&m=109035492329917&w=2 shubhrata, India - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating FO DOM directly
Hi, Is it possible using xslt and xsl:fo to detect a page break? basically I am using a for-each, and I want to show some data in the first row of a page whenever a new page begins. Any ideas? shubhrata, India - Original Message - From: "Jeremias Maerki" <[EMAIL PROTECTED]> To: Sent: Wednesday, September 27, 2006 5:21 PM Subject: Re: Creating FO DOM directly That may indeed look tempting but it is definitely not recommended because you'd mix content and layout in your Java code which is the sort of thing XSL (XSLT + XSL-FO) wants to keep apart. Furthermore, it's much easier to change an XSLT than to change the Java code if the layout changes. Finally, FOP does not provide an easy way to instantiate the FO tree manually. On 27.09.2006 12:43:01 Lars Ivar Igesund wrote: I need to create PDF from the information contained in some Java objects. The standard way to do this according to the FOP docs, is to create XML from the objects, then transform to XSL-FO using XSLT. But since there are FO DOM nodes internally in FOP, it seems to me to be a natural alternative to create these nodes directly instead of going via XML + XSLT. Is this possible, and how would I go about processing the tree? Regards, Lars Ivar Igesund Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating FO DOM directly
On 27.09.2006 13:15:34 Glen Mazza wrote: > Lars Ivar Igesund wrote: > > >I need to create PDF from the information contained in some Java objects. > >The > >standard way to do this according to the FOP docs, is to create XML from the > >objects, then transform to XSL-FO using XSLT. > > > > > > > > Yes. Learning XSLT (like Ant) is Time Very Well Spent. > > >But since there are FO DOM nodes internally in FOP, it seems to me to be a > >natural alternative to create these nodes directly instead of going via XML > >+ > >XSLT. > > > > > > I placed in such an example a few years back into our > {fop-dist}/examples/ directory, back in my ultra-newbie days. It's > quite hideous, but here it is: [1]. (Unfortunately, with the switch of > FOP's repository from CVS to SVN, we apparently have lost this deleted > file, but it remains in our CVS mailing list archives.) It's still there: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleDOM2PDF.java?view=markup But I do not recommend this approach. > [1] http://marc.theaimsgroup.com/?l=fop-cvs&m=106081657102191&w=2 > > >Is this possible, and how would I go about processing the tree? > > > > > > > > See above, but really look at these examples[2] for the XSLT & SAX-based > way of processing. This will prove much easier for you. > > [2] > http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ > > Glen Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating FO DOM directly
That may indeed look tempting but it is definitely not recommended because you'd mix content and layout in your Java code which is the sort of thing XSL (XSLT + XSL-FO) wants to keep apart. Furthermore, it's much easier to change an XSLT than to change the Java code if the layout changes. Finally, FOP does not provide an easy way to instantiate the FO tree manually. On 27.09.2006 12:43:01 Lars Ivar Igesund wrote: > I need to create PDF from the information contained in some Java objects. The > standard way to do this according to the FOP docs, is to create XML from the > objects, then transform to XSL-FO using XSLT. > > But since there are FO DOM nodes internally in FOP, it seems to me to be a > natural alternative to create these nodes directly instead of going via XML + > XSLT. > > Is this possible, and how would I go about processing the tree? > > Regards, > Lars Ivar Igesund Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating FO DOM directly
Glen Mazza apache.org> writes: > > Lars Ivar Igesund wrote: > > >I need to create PDF from the information contained in some Java objects. The > >standard way to do this according to the FOP docs, is to create XML from the > >objects, then transform to XSL-FO using XSLT. > > > > > > > > Yes. Learning XSLT (like Ant) is Time Very Well Spent. > > Glen > Thanks for the reply, I don't have a problem with XSLT (although I think it's quite hideous in itself), I'm just of the opinion that going via a whole set of xml-documents isn't always the best way :) Regards, Lars Ivar Igesund - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating FO DOM directly
Lars Ivar Igesund wrote: I need to create PDF from the information contained in some Java objects. The standard way to do this according to the FOP docs, is to create XML from the objects, then transform to XSL-FO using XSLT. Yes. Learning XSLT (like Ant) is Time Very Well Spent. But since there are FO DOM nodes internally in FOP, it seems to me to be a natural alternative to create these nodes directly instead of going via XML + XSLT. I placed in such an example a few years back into our {fop-dist}/examples/ directory, back in my ultra-newbie days. It's quite hideous, but here it is: [1]. (Unfortunately, with the switch of FOP's repository from CVS to SVN, we apparently have lost this deleted file, but it remains in our CVS mailing list archives.) [1] http://marc.theaimsgroup.com/?l=fop-cvs&m=106081657102191&w=2 Is this possible, and how would I go about processing the tree? See above, but really look at these examples[2] for the XSLT & SAX-based way of processing. This will prove much easier for you. [2] http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ Glen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating FO DOM directly
I need to create PDF from the information contained in some Java objects. The standard way to do this according to the FOP docs, is to create XML from the objects, then transform to XSL-FO using XSLT. But since there are FO DOM nodes internally in FOP, it seems to me to be a natural alternative to create these nodes directly instead of going via XML + XSLT. Is this possible, and how would I go about processing the tree? Regards, Lars Ivar Igesund - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]