Re: Background image - resolution changed during fop processing
Hi I tried to follow the hints on graphics resolution and set an image width using the content-width property. Unfortunately this did not work, probably because background-image itself is a property of fo:region-body.. I 'solved' the problem in the meantime by resampling the image to 72 dpi. This may work for simple images but for more complex ones the result may not be satisfactory when the pdf is printed. So I am still looking for a proper solution for this background-image problem. Regards Barbara Andreas L. Delmelle wrote: -Original Message- From: Barbara Baur [mailto:[EMAIL PROTECTED]] Hi, I want to include a background image (a png with a 200 dpi resolution) in the region body of a simple page master. In the outcoming pdf the resolution of the image has changed to 72 dpi which is of course not what I wanted. The image is far too big and doesn't fit the page size anymore. Why does this happen? I use fop 0.20.5 Check http://xml.apache.org/fop/graphics.html#resolution for more info about this. Note: could be that the supplied hints don't work for a background-image, I'm not sure. Hope this helps! (Don't hesitate to report back if it doesn't) Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
spanning columns
Hi List- I am relatively new to FO. I am trying to create a 2-column page with text that wraps into the next column at a position on the page. I can see it is possible by putting a leader in as shown in one of the Apache FOP examples, however I need to balance the text in the columns. Imagine that each column's text would then touch the bottom border. I would try this with tables but then I would have to know exactly where to break the text. Here's some ASCII art of what I need: |---| |Title1 | | |paragraph text1|t1 continue| |text1 text1 tex|d from prev| |t1 text1 text1 |ious column| |text1 text1 tex|balanced. | | | | |Title2 | | |paragraph text2|t2 continue| |text2 text2 tex|d+balance. | |---| I would appreciate any tips. Thanks. ¬¬¬ AgentM [EMAIL PROTECTED] ¬¬¬ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: spanning columns
A.M. wrote: Hi List- I am relatively new to FO. I am trying to create a 2-column page with text that wraps into the next column at a position on the page. I can see it is possible by putting a leader in as shown in one of the Apache FOP examples, however I need to balance the text in the columns. do you mean; fo:block span=allfo:leader//fo:block Imagine that each column's text would then touch the bottom border. I would try this with tables but then I would have to know exactly where to break the text. Here's some ASCII art of what I need: |---| |Title1 | | |paragraph text1|t1 continue| |text1 text1 tex|d from prev| |t1 text1 text1 |ious column| |text1 text1 tex|balanced. | | | | |Title2 | | |paragraph text2|t2 continue| |text2 text2 tex|d+balance. | |---| Column balancing isnt implemented properly in FOP 0.20.5 I'm afraid. You can experiment by adding some white space after the first lot of text. Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
question about performance
hi ... you can say that i'm a newbie in this FOP technology...infact, xml is a new area for me.. i want to use FOP to generate reports from our database... i tried some examples from the fop distribution..and then i made some experience, to generate a table with 12 columns and about 1000 rows from datas from xml ...it looks like this daten WDB123/WDB WDB2004321/WDB2004 WDB2003587/WDB2003 WDB2002456/WDB2002 WDB2001159/WDB2001 WDBA123/WDBA WDB2004B321/WDB2004B WDB2003C587/WDB2003C WDB2002D456/WDB2002D WDB2001E159/WDB2001E WDBF123/WDBF WDB2004G321/WDB2004G /daten later i found the problem,. that it tooked about 4-5 minutes to complete the request under servlet.. the table that I made from the stylesheet was very2 simple, without any graphic or something like that my questions : 1. would it be better if I use iText for large documents,... pick up the data directly from database 2 my friend told me, that I should use rather DOM file than XML file,it will be faster...is it true ? 3. have u guys any idea, what is the best solutions , to generate PDF from a large database , and that's on the fly.. thanks sandy soesilo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Free Visual tool for making fo files
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Juan, On May 23, 2004, at 2:48 PM, Juan Manuel Bellina wrote: I need to make a report in PDF file, so I want to know if there is a free XSL Template Designer to make my fo file in a simple way, some kind of visual tool that help me with this job. Thanks, Juan The FOP Resources page [1] has many tools which may fit your need. Among the tools I've spotted there, are the MPL Formatting Objects Authoring tool[2] and shareware FOEditor[3]. In addition, there's the html2fo[4], wh2f0[5] and RTF2FO[6]. Please take a look at it, and let us know which tool helped you most. Thanks! Finally, if you find any other tools in your search (have you tried http://www.google.com/ ;-)?), would you please report back and let us know? We're always looking for ways to improve our Resources page! Web Maestro Clay [1] http://xml.apache.org/fop/resources.html [2] Formatting Objects Authoring tool http://foa.sourceforge.net/ [3] FOEditor http://www.scruffyware.com/products/foeditor/ [4] html2fo http://html2fo.sourceforge.net/ [5] wh2f0 http://wh2fo.sourceforge.net/ [6] RTF2FO http://www.rtf2fo.com/ Clay Leeds - [EMAIL PROTECTED] - -- Web Developer - Medata, Inc. - http://www.medata.com/ PGP Public Key: https://mail.medata.com/pgp/cleeds.asc -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (Darwin) iEYEARECAAYFAkCxJ6oACgkQRixs4Cbu7ehc4ACgmJaOLwtO61rae1AKtIA5FHft FsUAoKuz6/D9Cb1+8FGfmlFc8Odm97BH =pZ8B -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
unwanted blank page because of page count
I need to insert just one blank page after page 6. The problem is, the next page after page 7 must be page iii, which is an odd page. That means that xsl-fo inserts *two* blank pages in order to make sure that page iii starts on the right side. The requirements for the thesis insist that one blank page be inserted after page 6. Is there any way I can get xsl-of to insert just one blank page? My code is below. Thanks Paul ** fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force -- *Paul Tremblay * [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unwanted blank page because of page count
Paul, On May 25, 2004, at 8:29 AM, Paul Tremblay wrote: I need to insert just one blank page after page 6. The problem is, the next page after page 7 must be page iii, which is an odd page. That means that xsl-fo inserts *two* blank pages in order to make sure that page iii starts on the right side. The requirements for the thesis insist that one blank page be inserted after page 6. Is there any way I can get xsl-of to insert just one blank page? My code is below. Thanks Paul ** fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force Can you confirm that the issue is not related to this FAQ: http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences Perhaps there is something there which may help. Thanks! Web Maestro Clay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Background image - resolution changed during fop processing
-Original Message- From: Barbara Baur [mailto:[EMAIL PROTECTED] Hi, snip / So I am still looking for a proper solution for this background-image problem. One known workaround is to use a static-content bound to a region-before or region-after that overlaps the entire region-body. Then inside that static-content, you can use a fo:external-graphic to insert the background image. (IIC, it should end up in the background) In that way, you have more options at your disposal to control the size of the graphic (and as a consequence also its resolution). Obviously this one depends on whether you're already using the region-before or -after... Afraid this is all I can give you for the moment. If you need any further assistance, just give us a yell. Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unwanted blank page because of page count
On Tue, May 25, 2004 at 08:55:20AM -0700, Clay Leeds wrote: fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force Can you confirm that the issue is not related to this FAQ: http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences Perhaps there is something there which may help. Thanks! Web Maestro Clay Thanks for your response. I had already looked at that FAQ. That's how I knew to put the force-page-count=no-force in the page sequence element. Perhaps my problem is an issue with xsl-fo and not with fop? Maybe xsl-fo *always* forces odd pages to start on odd pages, regardless of the force-page-count attribute? Thanks Paul -- *Paul Tremblay * [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unwanted blank page because of page count
Paul, On May 25, 2004, at 9:20 AM, Paul Tremblay wrote: On Tue, May 25, 2004 at 08:55:20AM -0700, Clay Leeds wrote: fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force Can you confirm that the issue is not related to this FAQ: http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences Perhaps there is something there which may help. Thanks! Web Maestro Clay Thanks for your response. I had already looked at that FAQ. That's how I knew to put the force-page-count=no-force in the page sequence element. Perhaps my problem is an issue with xsl-fo and not with fop? Maybe xsl-fo *always* forces odd pages to start on odd pages, regardless of the force-page-count attribute? Thanks Paul I guess that's possible. It's also possible that whatever problem you're having is due to portions of fop-0.20.5 not yet in compliance with the spec (FOP is 'moving towards' the spec, but check the Compliance page[1] to (currently shows 'basic' compliance, but not 'extended' nor 'complete' compliance with force-page-count object). Nonetheless, trying every value for force-page-count might yield different/better results.. Web Maestro Clay [1] http://xml.apache.org/fop/compliance.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Symbol ZapfDingats font doesn't render
I cannot get Symbol font to render. Here is a snippet of my code: fo:block font-family = Symbol Hello world in Symbol /fo:block I don't get an error message when fop runs, but when I open the resulting file in a PDF viewer, I see: # # ## ## I get a simlar problem when I use ZapfDingbats: rather than differnet characters, I see the scissors symbol repeated for each letter. I believe Symbol and ZapfDingbats are built into fop, right? (By the way, are there any other fonts built it, besides Times, Helvitical, and Courrier?) Thanks Paul -- *Paul Tremblay * [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Symbol ZapfDingats font doesn't render
Paul, On May 25, 2004, at 9:52 AM, Paul Tremblay wrote: I cannot get Symbol font to render. Here is a snippet of my code: fo:block font-family = Symbol Hello world in Symbol /fo:block I don't get an error message when fop runs, but when I open the resulting file in a PDF viewer, I see: # # ## ## I get a simlar problem when I use ZapfDingbats: rather than differnet characters, I see the scissors symbol repeated for each letter. I believe Symbol and ZapfDingbats are built into fop, right? (By the way, are there any other fonts built it, besides Times, Helvitical, and Courrier?) Thanks Paul I don't know why it's not working for you. Is it possible you don't have Symbol on *your* system? (Do you get errors when running FOP? Try running FOP with the '-d' debug flag...). Try loading it on another computer. BTW, the definitive source for information is the FOP Fonts page[1]. Web Maestro Clay p.s. It's also possible you 'typed' 'Symbol' incorrectly. I notice that you've misspelled 'Helvetica' and 'Courier'. As for others, there are 14 'base fonts', but they are normal, bold, italic, bold italic variants of Helvetica, Times Courier, plus Symbol ZapfDingbats. [1] http://xml.apache.org/fop/fonts.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: question about performance
-Original Message- From: [EMAIL PROTECTED] Hi, snip / my questions : 1. would it be better if I use iText for large documents,... pick up the data directly from database It could well be (depends on your code, anyway :) ) Downside of course is maintenance of this piece of software. Maybe there are a few standardized solutions out there that fit your description, I'm not sure. 2 my friend told me, that I should use rather DOM file than XML file,it will be faster...is it true ? Yes, but ... DOM first has to create an object structure representing the document in memory, so can be quite a mem-eater if the source XML is large (--on top of that: creating the document representation also has its cost) The advantages of DOM over SAX depend largely on what you actually need to extract from the source XML, whether you need repeated access to the same nodes etc. For as far as I understand FOP's processing model: SAX is used to parse the input XML (FO), and the generated SAX events are caught and mapped to an object-tree. ( Each SAX event creates a certain type of object in the FOTree ) In essence, all the FO nodes in the source document are accessed only once, namely to create an FObj representing it. IIC, this makes using a DOM input source rather suboptimal, since first the DOM representation must be created, and then that tree is used merely to create another tree --anyway, the nodes are accessed only once... Don't get this the wrong way: DOM might be useful for the source XML to the XSL transform which creates the FO, especially if you need to transform the same XML document multiple (make that: numerous) times. 3. have u guys any idea, what is the best solutions, to generate PDF from a large database, and that's on the fly.. Hmm... XSL-FO is designed exactly to serve purposes like this. That being said: is it actually FOP's processing that takes a long time, or is it the XSL transform? Can you test this a bit maybe? Run the XSL transform separately (preferrably also through another processor than Xalan to compare results). Just adding this, because I know out of experience that 'newbie' code can easily drain an XSLT processor's resources. Things like double forward slashes ( '//*' ) might seem 'handy' in being able to retrieve a node from any context in the stylesheet, but an explicit XPath expression pointing at exactly the right node saves the processor a few (--possibly quite a few) unnecessary tree traversals. Also, could you do a bit more research on whether it is the context of the servlet that creates the delay? Try rendering the same XML+XSLT via the command-line, and see if there's any noticeable difference... Hope this helps! Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: question about performance
Sandy, On May 25, 2004, at 11:04 AM, Andreas L. Delmelle wrote: Hmm... XSL-FO is designed exactly to serve purposes like this. That being said: is it actually FOP's processing that takes a long time, or is it the XSL transform? Can you test this a bit maybe? Run the XSL transform separately (preferrably also through another processor than Xalan to compare results). Just adding this, because I know out of experience that 'newbie' code can easily drain an XSLT processor's resources. Things like double forward slashes ( '//*' ) might seem 'handy' in being able to retrieve a node from any context in the stylesheet, but an explicit XPath expression pointing at exactly the right node saves the processor a few (--possibly quite a few) unnecessary tree traversals. Also, could you do a bit more research on whether it is the context of the servlet that creates the delay? Try rendering the same XML+XSLT via the command-line, and see if there's any noticeable difference... Hope this helps! Greetz, Andreas To continue a bit on where I think Andreas was headed, there's a script distributed with FOP, you can use to test the XSL portion: Xalan. The scripts are called 'xalan.bat' (Windows/DOS) and 'xalan.sh' (the rest of us) The cmd line is simple: xalan.sh version: xalan.sh -IN input.xml -XSL input.xsl -OUT output.fo xalan.bat version xalan.bat -IN input.xml -XSL input.xsl -OUT output.fo There are other commands which you can see by running xalan.bat/xalan.sh with no arguments. Hope this helps! Web Maestro Clay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Symbol ZapfDingats font doesn't render (Solved)
On Tue, May 25, 2004 at 10:06:53AM -0700, Clay Leeds wrote: Try loading it on another computer. I did that and still got the same problem. Then it dawned on me: I needed to use acutal Greek letters and Zapf Dingbats! Once I tried the code with Delta, I saw a correct rendering. Duh! Thanks Paul -- *Paul Tremblay * [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems visualing tables
I am using FOP 0.20.5 to make a report to a PDF file. I make a table with some data but when I open the pdf file generated, the table are not showed. Any ideas? Anybody had the some problem? __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems visualing tables
-Original Message- From: Juan Manuel Bellina [mailto:[EMAIL PROTECTED] Sent: dinsdag 25 mei 2004 21:41 I am using FOP 0.20.5 to make a report to a PDF file. I make a table with some data but when I open the pdf file generated, the table are not showed. Any ideas? Could mean a number of things, so, not immediately, no... Is it possible to send us a stripped-down version of the source FO demonstrating the problem? Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Alternatives to auto table layout
Hi, I'm just curious to know what people have found works best for them as an alternative to achieving somewhat auto table layout? I'm currently trying to figure out what I should do. I've just started learning XSL as a result of beginning to use FOP to try to automatically create a catalogue from data stored within a MySQL database. The only idea I've had so far, was to use the maximum column lengths as returned from PHP's mysql_fetch_field() to somehow formulate a proportional-column-width() value for the column-widths. As for the formula... I have no clue what that might be yet! :) James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems visualing tables
Andres: First of all, thanks for your sooner response. Let me tell that I found this mesage in the console when i executed the redering. /*** [WARNING] table-layout=auto is not supported, using fixed! [WARNING] current implementation of tables requires a table-column for each column, indicating column-width ***/ What do you think the problem is? I put a little peace of code, as you ask. /*** fo:table-row fo:table-cell fo:blockTITLE COL 1 /fo:block /fo:table-cell fo:table-cell fo:blockfo:inline color=#00 language=en-US font-size=12pt font-family=Times New Roman font-weight=normal font-style=normal text-decoration=noneTITLE /fo:inlineCOL 2 /fo:block /fo:table-cell fo:table-cell fo:blockfo:inline color=#00 language=en-US font-size=12pt font-family=Times New Roman font-weight=normal font-style=normal text-decoration=noneTITLE /fo:inlineCOL 3 /fo:block /fo:table-cell /fo:table-row / --- Andreas L. Delmelle [EMAIL PROTECTED] wrote: -Original Message- From: Juan Manuel Bellina [mailto:[EMAIL PROTECTED] Sent: dinsdag 25 mei 2004 21:41 I am using FOP 0.20.5 to make a report to a PDF file. I make a table with some data but when I open the pdf file generated, the table are not showed. Any ideas? Could mean a number of things, so, not immediately, no... Is it possible to send us a stripped-down version of the source FO demonstrating the problem? Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems visualing tables
It looks like you're missing fo:table-column and, perhaps fo:table-body. There's a FAQ about this: http://xml.apache.org/fop/faq.html#table-missing Make certain you've added fo:table-column. There's another FAQ immediately preceding the table-missing issue which has a complete example of a table: http://xml.apache.org/fop/faq.html#keep-with Good luck! Web Maestro Clay On May 25, 2004, at 1:24 PM, Juan Manuel Bellina wrote: Andres: First of all, thanks for your sooner response. Let me tell that I found this mesage in the console when i executed the redering. /*** [WARNING] table-layout=auto is not supported, using fixed! [WARNING] current implementation of tables requires a table-column for each column, indicating column-width ***/ What do you think the problem is? I put a little peace of code, as you ask. /*** fo:table-row fo:table-cell fo:blockTITLE COL 1 /fo:block /fo:table-cell fo:table-cell fo:blockfo:inline color=#00 language=en-US font-size=12pt font-family=Times New Roman font-weight=normal font-style=normal text-decoration=noneTITLE /fo:inlineCOL 2 /fo:block /fo:table-cell fo:table-cell fo:blockfo:inline color=#00 language=en-US font-size=12pt font-family=Times New Roman font-weight=normal font-style=normal text-decoration=noneTITLE /fo:inlineCOL 3 /fo:block /fo:table-cell /fo:table-row / --- Andreas L. Delmelle [EMAIL PROTECTED] wrote: -Original Message- From: Juan Manuel Bellina [mailto:[EMAIL PROTECTED] Sent: dinsdag 25 mei 2004 21:41 I am using FOP 0.20.5 to make a report to a PDF file. I make a table with some data but when I open the pdf file generated, the table are not showed. Any ideas? Could mean a number of things, so, not immediately, no... Is it possible to send us a stripped-down version of the source FO demonstrating the problem? Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ - 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: Problems visualing tables
Juan Manuel Bellina wrote: /*** [WARNING] table-layout=auto is not supported, using fixed! [WARNING] current implementation of tables requires a table-column for each column, indicating column-width Read the warning carefully. FOP 0.20.5 requires you to supply definitions for all table rows: fo:table table-layout=fixed fo:table-column column-width=5cm/ ... I put a little peace of code, as you ask. /*** fo:table-row I can't tell from you code snippet, but you should check this FAQ too: http://xml.apache.org/fop/faq.html#table-missing J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Alternatives to auto table layout
-Original Message- From: James Earl [mailto:[EMAIL PROTECTED] Hi, snip / I'm just curious to know what people have found works best for them as an alternative to achieving somewhat auto table layout? I'm currently trying to figure out what I should do. I've just started learning XSL as a result of beginning to use FOP to try to automatically create a catalogue from data stored within a MySQL database. The only idea I've had so far, was to use the maximum column lengths as returned from PHP's mysql_fetch_field() to somehow formulate a proportional-column-width() value for the column-widths. As for the formula... I have no clue what that might be yet! :) Hmm. proportional-column-width() could indeed do the trick here. Too bad XSLT doesn't have aggregate functions min() or max(), but this can be worked around rather easily. Say your source XML looks like (--and you are actually using XML+XSLT to generate FO...) root record field index=1Some piece of text/field field index=2A slightly longer portion of text/field /record record field index=1Longer text in first field/field field index=2Shorter text in field two/field /record /root Then, in XSLT, to construct a table offering the maximum field lengths mapped to column-widths, you could do something like (pseudo-code --well, almost... the code actually works): xsl:template match=root fo:table table-layout=fixed width=100% !-- use the first row as basis; we only need the first row to determine the number of columns (see CSS spec) -- xsl:apply-templates select=record[1]/field mode=col-create / fo:table-body xsl:apply-templates select=record mode=row-create / /fo:table-body /fo:table /xsl:template xsl:template match=field mode=col-create !-- create a variable to contain the maximum field-width ... -- xsl:variable name=vMax !-- iterate over all fields with the same @index ... -- xsl:for-each select=/*/record/[EMAIL PROTECTED]()/@index] !-- sort in descending order -- xsl:sort select=string-length() order=descending / !-- the first one in sorted order is the one we need -- xsl:if test=position()=1 xsl:value-of select=string-length() / /xsl:if /xsl:for-each /xsl:variable !-- ... and use this maximum for prop-col-width -- fo:table-column column-number=[EMAIL PROTECTED] column-width={concat('proportional-column-width(', $vMax,')')} / /xsl:template xsl:template match=record mode=row-create fo:table-row xsl:for-each select=field fo:table-cell column-number=[EMAIL PROTECTED] fo:block xsl:value-of select=. / /fo:block /fo:table-cell /fo:table-row /xsl:template Hope this gives you a clue... Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Alternatives to auto table layout
-Original Message- From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED] Hi, Before I forget to mention: !-- ... and use this maximum for prop-col-width -- fo:table-column column-number=[EMAIL PROTECTED] The column-number property is used here, but is still unimplemented in FOP 0.20.5 (it *will* be in the next version, though... it partly is in my local version anyway :) A bit of fine-tuning still required ) Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Alternatives to auto table layout
-Original Message- From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED] Erratum: Too bad XSLT doesn't have aggregate functions min() or max(), but this can be worked around rather easily. Should be XSLT *1.0* XPath 2.0 (= XSLT 2.0) *does* support these functions. Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Alternatives to auto table layout
On Tue, 2004-05-25 at 16:08, Andreas L. Delmelle wrote: -Original Message- From: James Earl [mailto:[EMAIL PROTECTED] Hi, snip / I'm just curious to know what people have found works best for them as an alternative to achieving somewhat auto table layout? I'm currently trying to figure out what I should do. I've just started learning XSL as a result of beginning to use FOP to try to automatically create a catalogue from data stored within a MySQL database. The only idea I've had so far, was to use the maximum column lengths as returned from PHP's mysql_fetch_field() to somehow formulate a proportional-column-width() value for the column-widths. As for the formula... I have no clue what that might be yet! :) Hmm. proportional-column-width() could indeed do the trick here. Too bad XSLT doesn't have aggregate functions min() or max(), but this can be worked around rather easily. Say your source XML looks like (--and you are actually using XML+XSLT to generate FO...) root record field index=1Some piece of text/field field index=2A slightly longer portion of text/field /record record field index=1Longer text in first field/field field index=2Shorter text in field two/field /record /root Then, in XSLT, to construct a table offering the maximum field lengths mapped to column-widths, you could do something like (pseudo-code --well, almost... the code actually works): xsl:template match=root fo:table table-layout=fixed width=100% !-- use the first row as basis; we only need the first row to determine the number of columns (see CSS spec) -- xsl:apply-templates select=record[1]/field mode=col-create / fo:table-body xsl:apply-templates select=record mode=row-create / /fo:table-body /fo:table /xsl:template xsl:template match=field mode=col-create !-- create a variable to contain the maximum field-width ... -- xsl:variable name=vMax !-- iterate over all fields with the same @index ... -- xsl:for-each select=/*/record/[EMAIL PROTECTED]()/@index] !-- sort in descending order -- xsl:sort select=string-length() order=descending / !-- the first one in sorted order is the one we need -- xsl:if test=position()=1 xsl:value-of select=string-length() / /xsl:if /xsl:for-each /xsl:variable !-- ... and use this maximum for prop-col-width -- fo:table-column column-number=[EMAIL PROTECTED] column-width={concat('proportional-column-width(', $vMax,')')} / /xsl:template xsl:template match=record mode=row-create fo:table-row xsl:for-each select=field fo:table-cell column-number=[EMAIL PROTECTED] fo:block xsl:value-of select=. / /fo:block /fo:table-cell /fo:table-row /xsl:template Hope this gives you a clue... Greetz, Andreas Thanks for the example. vMax is a string length in this example though, right? Correct me if I'm wrong, but I don't think proportional-column-width() will work with a string length will it? James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]