reading fo tags from database and using within xsl dynamically
Hi, We need to read it a value dynamically from the database. and this value contains fop tags such as fo:block blah blah blah /fo:block fo:block blah blah this is the second block /fo:block Is there any way to display that within the xsl (this xsl contains other fop tags too)? We tried following xsl:template match=DISCLAIMER xsl:value-of select=./ /xsl:template we also tried and xsl:copy-of and disable-output-escaping=yes... but none of them works... Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FOP servlet is called multiple times!!
Title: FOP servlet is called multiple times!! How would we trouble shoot this? We never saw this happening until we rolled out our app to the production, which uses https. And it does not happen consistently!! Help!! We see this on FOP FAQ, and the second bullet point says we should not set any headers - we are not setting anything unusual - except below. response.setContentType( CONTENT_TYPE_PDF ); // where CONTENT_TYPE_PDF is application/pdf response.setHeader( Content-Disposition, attachment; filename= + reportTag + _ + FormatterUtils.formatDate( gCal.getTime(), FormatterUtils.dMMM ) 7.1. The FOP servlet is called multiple times!^ This is a problem of Internet Explorer requesting the content several times. Some suggestions: Use an URL ending in .pdf, like http://myserver/servlet/stuff.pdf. Yes, the servlet can be configured to handle this. If the URL has to contain parameters, try to have both the base URL as well as the last parameter end in .pdf, if necessary append a dummy parameter, like http://myserver/servlet/stuff.pdf?par1=apar2=bd=.pdf. The effect may depend on IEx version. Give IEx the opportunity to cache. In particular, ensure the server does not set any headers causing IEx not to cache the content. This may be a real problem if the document is sent over HTTPS. Consult your server manual. Cache in the server. Including a parameter in the URL which has a timestamp as the value may help you to decide whether a request is repeated. IEx is reported to retrieve a document up to three times, but never more often. - what does it mean/
repeat fo:table-row on a new page?
Hello - I have a long table that spans over a number of pages. I have a fo:table-header repeat over multiple pages - using table-omit-header-at-break=false I have some sub column titles in fo:table-rowfo:table-cell /fo:table-row/fo:table-cell that need to be also repeated on a new page. How would I repeat them? Thanks IL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
fo:block on a new page
I have some fo:block(s) that need to start on a new page... However I like to make an exception for the first fo:block so that I don't get the first blank page... Is there any smart way to do it without introducing fo:conditional-page-master-reference? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
quick question on aligning table in region-body
How would I center the whole table? I was hoping to do display-align=center to fo:table, but it didn't work... fo:region-body doesn't seem to take display-align=center, so I'm trying to do margin-left=2cm to region-body or fo:table, but it complains about [INFO] area contents overflows area... any simple way to center the fo:region-body? Thanks I have a following setup... fo:layout-master-set fo:simple-page-master master-name=anypage page-width=21.0cm page-height=29.7cm margin-top=0.5cm margin-bottom=0.5cm margin-left=1.5cm margin-right=1.5cm fo:region-body region-name=xsl-region-body margin-top=0.5cm margin-bottom=1.5cm/ fo:region-before region-name=xsl-region-before extent=0cm/ fo:region-after region-name=xsl-region-after extent=0.8cm/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=anypage fo:flow flow-name=xsl-region-body xsl:apply-templates select=REPORT_NAME/ xsl:apply-templates select=CREATED_BY/ fo:table table-omit-header-at-break=false table-layout=fixed fo:table-header fo:table-row fo:table-cell border-collapse=collapse space-before=0pt number-columns-spanned=2 fo:block space-after=0.2cm fo:leader leader-length=100% leader-pattern=rule/ /fo:block /fo:table-cell /fo:table-row - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
proxyServlet - delegating work
Title: proxyServlet - delegating work Hello, This is more like a servlet question, could you please help? We decided to designate another tomcat instance for PDF/FOP processing. In tomcat servlet container we do something like Driver driver = new Driver(); Logger log = new ConsoleLogger( ConsoleLogger.LEVEL_INFO ); MessageHandler.setScreenLogger( log ); driver.setLogger( log ); driver.setRenderer( Driver.RENDER_PDF ); driver.setOutputStream( response.getOutputStream()) transformer.transform( inXML, new SAXResult( driver.getContentHandler())); and from the proxy servlet from the main server, we call PDF/FOP servlet by URL url = "" URL(http,myserver.com,8881,/sp/xmlReport? + urlParams ); BufferedReader in = new BufferedReader( new InputStreamReader( url.openStream())); String line; while( ( line = in.readLine()) != null ) out.println( line ); out.flush(); This approach works well with html/excel XSL/XSLT, but not with pdf/FOP What would I need to tweak in proxy servlet to get this to work? Thanks for any suggestion or help!
RE: Writing efficient XSL
Title: RE: Writing efficient XSL Matt, Mymax memorygoes up to 256MB.. When I generate *.fo by merging XML with XSL : that takes 40 seconds.. (Using command like java -cp ~leeins/weblogic/3rd_party_jars_SUN/xalan-j_2_3_1_01.jar:/home/amchitmgr/build/jakarta-ant-1.5.1/lib/xml-apis.jar:/home/amchitmgr/build/jakarta-ant-1.5.1/lib/xercesImpl.jar org.apache.xalan.xslt.Process -IN rates.xml -XSL rates_pdf.xsl -OUT rates.fo) When I put this rates.fo thru Driver, it takes 5 minutes... generating 20 pages of pdf file... Where is the bottleneck? The machine is UNIX with 8 CPU and 10GB memroy... it seems that JDK1.3 and Xalan2.4.1 performs slightly better.., but not much.. Thanks -Original Message-From: Savino, Matt C [mailto:[EMAIL PROTECTED]Sent: Thursday, February 20, 2003 6:35 PMTo: [EMAIL PROTECTED]Subject: RE: Writing efficient XSL If you can "generate the FO object relatively quickly", then you should be already past the XSL stage and into the FO processing (Driver.run()). Unless I am interpreting this wrong. If so try writing your FO out to a file to see how long it takes. How many pages is your report when it finally finishes? Other people on this board are better experts when it comes to performance-tuning your FO. 20 minutes sounds excessive for about anything though. What is your heap size? -Matt -Original Message-----From: Lee, Insoo [mailto:[EMAIL PROTECTED]Sent: Thursday, February 20, 2003 3:17 PMTo: '[EMAIL PROTECTED]'Subject: RE: Writing efficient XSL Hi, I have something like this ?xml version="1.0" encoding="UTF-8" ? REPORT REPORT_NAMEPrior Day Rates/REPORT_NAME DATE_RANGEfor 19 Feb 2003/DATE_RANGE REPORT_TAG / DATE_FROM1 Feb 2003/DATE_FROM DATE_TO19 Feb 2003/DATE_TO CREATED_BYleeins/CREATED_BY EXCEL_DATE_FROM1%20Feb%202003/EXCEL_DATE_FROM EXCEL_DATE_TO19%20Feb%202003/EXCEL_DATE_TO EXCEL_CREATED_DATE_AND_TIMEThu%2023%20Jan%202003%203:05:34%20PM%20ET/EXCEL_CREATED_DATE_AND_TIME CREATED_DATE_AND_TIMEThu 23 Jan 2003 3:05:34 PM ET/CREATED_DATE_AND_TIME SELECTED_SORT0/SELECTED_SORT SELECTED_FUNDALL/SELECTED_FUND FUND_GROUP CURRENCY="GBP" STATUS="Active" FUND_ROW TA_FUND_CODEGF6/TA_FUND_CODE LONG_NAMEILA Treasury Obligations Inst/LONG_NAME DAILY_FACTOR0.2156000/DAILY_FACTOR SHORT_RATE_3651.02/SHORT_RATE_365 LONG_RATE_3651.0449400/LONG_RATE_365 RATE_3601.0642200/RATE_360 CURR_7_DAY_YIELDNA/CURR_7_DAY_YIELD SEVEN_DAY_EFF_YIELD0.99/SEVEN_DAY_EFF_YIELD AVG_30_DAY_RATE1.26/AVG_30_DAY_RATE PRICE1./PRICE RATE_DATE1 Feb 2003/RATE_DATE CURRENCYGBP/CURRENCY AS_OF_DATE20 Feb 2003/AS_OF_DATE PERIODIC_FAMILY_NAMEMy Fund/PERIODIC_FAMILY_NAME ISIN / CUSIP38XX2B765/CUSIP /FUND_ROW and 1,000 or so FUND_ROW Thanks! -Original Message-From: Calero, Roberto [mailto:[EMAIL PROTECTED]Sent: Thursday, February 20, 2003 5:35 PMTo: '[EMAIL PROTECTED]'Subject: RE: Writing efficient XSLImportance: High How about the data file? -Original Message- From: Lee, Insoo [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 4:01 AM To: [EMAIL PROTECTED] Subject: Writing efficient XSL Could you please take a quick look at my XSL and see where I can improve it?... I know it's a very vague request, but I would appreciate any comments or advice... I can generate FO object relative quickly, but when generating 20 pages, it takes about 5 minutes.. (Driver.run()) and I think my XSL is not efficiently written.. I basically have one big table because I need to repeat column headings.. people say I need to make smaller tables, but how would I do that without counting lines to be on one page... (without relying on page header) Thanks ?xml version="1.0"? xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:attribute-set name="column-heading" xsl:attribute name="font-family"Helvetica/xsl:attribute xsl:attribute name="font-weight"bold/xsl:attribute xsl:attribute name="font-size"8pt/xsl:attribute xsl:attribute name="text-align"left/xsl:attribute /xsl:attribute-set xsl:attribute-set name="table-content" xsl:attribute name="font-family"Helvetica/xsl:attribute xsl:attribute name="font-size"8pt/xsl:attribute /xsl:attribute-set xsl:attribute-set name="table-content-right"
RE: Writing efficient XSL
Hello, Is there quick sample that I can take a look? So, I would have to 1) count the # of lines per page and dump out to a table everytime page changes 2) rely on region-before for column headings... - Only thing is the column needs to be dynamic depending on the contents... -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Thursday, February 20, 2003 6:47 PM To: [EMAIL PROTECTED] Subject: Re: Writing efficient XSL Lee, Insoo wrote: I basically have one big table because I need to repeat column headings.. Have you checked whether you can put the repeating header into the static-content of the region-before? I can generate FO object relative quickly, but when generating 20 pages, it takes about 5 minutes.. (Driver.run()) Depending on your environment, this is not necessarily a bad time. J.Pietschmann - 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]
Writing efficient XSL
Could you please take a quick look at my XSL and see where I can improve it?... I know it's a very vague request, but I would appreciate any comments or advice... I can generate FO object relative quickly, but when generating 20 pages, it takes about 5 minutes.. (Driver.run()) and I think my XSL is not efficiently written.. I basically have one big table because I need to repeat column headings.. people say I need to make smaller tables, but how would I do that without counting lines to be on one page... (without relying on page header) Thanks ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:attribute-set name=column-heading xsl:attribute name=font-familyHelvetica/xsl:attribute xsl:attribute name=font-weightbold/xsl:attribute xsl:attribute name=font-size8pt/xsl:attribute xsl:attribute name=text-alignleft/xsl:attribute /xsl:attribute-set xsl:attribute-set name=table-content xsl:attribute name=font-familyHelvetica/xsl:attribute xsl:attribute name=font-size8pt/xsl:attribute /xsl:attribute-set xsl:attribute-set name=table-content-right xsl:attribute name=font-familyHelvetica/xsl:attribute xsl:attribute name=font-size8pt/xsl:attribute xsl:attribute name=text-alignright/xsl:attribute /xsl:attribute-set xsl:attribute-set name=table-content-bold xsl:attribute name=font-familyHelvetica/xsl:attribute xsl:attribute name=font-weightbold/xsl:attribute xsl:attribute name=font-size8pt/xsl:attribute /xsl:attribute-set xsl:template match=/REPORT fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; !-- START OF LAYOUT-MASTER-SET -- fo:layout-master-set fo:simple-page-master master-name=anypage page-width=29.7cm page-height=21.0cm margin-top=0.5cm margin-bottom=0.5cm margin-left=1.5cm margin-right=1.5cm fo:region-body margin-top=0.5cm margin-bottom=1.5cm/ fo:region-before extent=0cm/ fo:region-after extent=0.5cm/ /fo:simple-page-master /fo:layout-master-set !-- END OF LAYOUT-MASTER-SET -- fo:page-sequence master-reference=anypage fo:flow flow-name=xsl-region-body xsl:apply-templates select=REPORT_NAME/ xsl:apply-templates select=CREATED_BY/ xsl:for-each select=FUND_GROUP fo:table table-omit-header-at-break=false table-layout=fixed fo:table-header fo:table-row fo:table-cell border-collapse=collapse number-columns-spanned=11 fo:block font-size=12pt text-align=left font-family=Helvetica space-after=0pt font-weight=bold xsl:choose xsl:when test=@STATUS!='Single' xsl:value-of select=@STATUS/ xsl:text#160;/xsl:textxsl:value-of select=@CURRENCY/ Funds /xsl:when xsl:otherwise Single Fund Report /xsl:otherwise /xsl:choose /fo:block /fo:table-cell /fo:table-row fo:table-row fo:table-cell border-collapse=collapse space-before=0pt number-columns-spanned=11 fo:block fo:leader leader-length=100% leader-pattern=rule/ /fo:block /fo:table-cell /fo:table-row fo:table-row fo:table-cell display-align=center fo:block xsl:use-attribute-sets=column-heading Fund /fo:block /fo:table-cell fo:table-cell display-align=center number-columns-spanned=2 fo:block xsl:use-attribute-sets=column-heading Date /fo:block /fo:table-cell fo:table-cell display-align=center fo:block
RE: Writing efficient XSL
Title: RE: Writing efficient XSL Hi, I have something like this ?xml version="1.0" encoding="UTF-8" ? REPORT REPORT_NAMEPrior Day Rates/REPORT_NAME DATE_RANGEfor 19 Feb 2003/DATE_RANGE REPORT_TAG / DATE_FROM1 Feb 2003/DATE_FROM DATE_TO19 Feb 2003/DATE_TO CREATED_BYleeins/CREATED_BY EXCEL_DATE_FROM1%20Feb%202003/EXCEL_DATE_FROM EXCEL_DATE_TO19%20Feb%202003/EXCEL_DATE_TO EXCEL_CREATED_DATE_AND_TIMEThu%2023%20Jan%202003%203:05:34%20PM%20ET/EXCEL_CREATED_DATE_AND_TIME CREATED_DATE_AND_TIMEThu 23 Jan 2003 3:05:34 PM ET/CREATED_DATE_AND_TIME SELECTED_SORT0/SELECTED_SORT SELECTED_FUNDALL/SELECTED_FUND FUND_GROUP CURRENCY="GBP" STATUS="Active" FUND_ROW TA_FUND_CODEGF6/TA_FUND_CODE LONG_NAMEILA Treasury Obligations Inst/LONG_NAME DAILY_FACTOR0.2156000/DAILY_FACTOR SHORT_RATE_3651.02/SHORT_RATE_365 LONG_RATE_3651.0449400/LONG_RATE_365 RATE_3601.0642200/RATE_360 CURR_7_DAY_YIELDNA/CURR_7_DAY_YIELD SEVEN_DAY_EFF_YIELD0.99/SEVEN_DAY_EFF_YIELD AVG_30_DAY_RATE1.26/AVG_30_DAY_RATE PRICE1./PRICE RATE_DATE1 Feb 2003/RATE_DATE CURRENCYGBP/CURRENCY AS_OF_DATE20 Feb 2003/AS_OF_DATE PERIODIC_FAMILY_NAMEMy Fund/PERIODIC_FAMILY_NAME ISIN / CUSIP38XX2B765/CUSIP /FUND_ROW and 1,000 or so FUND_ROW Thanks! -Original Message-From: Calero, Roberto [mailto:[EMAIL PROTECTED]Sent: Thursday, February 20, 2003 5:35 PMTo: '[EMAIL PROTECTED]'Subject: RE: Writing efficient XSLImportance: High How about the data file? -Original Message- From: Lee, Insoo [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 4:01 AM To: [EMAIL PROTECTED] Subject: Writing efficient XSL Could you please take a quick look at my XSL and see where I can improve it?... I know it's a very vague request, but I would appreciate any comments or advice... I can generate FO object relative quickly, but when generating 20 pages, it takes about 5 minutes.. (Driver.run()) and I think my XSL is not efficiently written.. I basically have one big table because I need to repeat column headings.. people say I need to make smaller tables, but how would I do that without counting lines to be on one page... (without relying on page header) Thanks ?xml version="1.0"? xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:attribute-set name="column-heading" xsl:attribute name="font-family"Helvetica/xsl:attribute xsl:attribute name="font-weight"bold/xsl:attribute xsl:attribute name="font-size"8pt/xsl:attribute xsl:attribute name="text-align"left/xsl:attribute /xsl:attribute-set xsl:attribute-set name="table-content" xsl:attribute name="font-family"Helvetica/xsl:attribute xsl:attribute name="font-size"8pt/xsl:attribute /xsl:attribute-set xsl:attribute-set name="table-content-right" xsl:attribute name="font-family"Helvetica/xsl:attribute xsl:attribute name="font-size"8pt/xsl:attribute xsl:attribute name="text-align"right/xsl:attribute /xsl:attribute-set xsl:attribute-set name="table-content-bold" xsl:attribute name="font-family"Helvetica/xsl:attribute xsl:attribute name="font-weight"bold/xsl:attribute xsl:attribute name="font-size"8pt/xsl:attribute /xsl:attribute-set xsl:template match="/REPORT" fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" !-- START OF LAYOUT-MASTER-SET -- fo:layout-master-set fo:simple-page-master master-name="anypage" page-width="29.7cm" page-height="21.0cm" margin-top="0.5cm" margin-bottom="0.5cm" margin-left="1.5cm" margin-right="1.5cm" fo:region-body margin-top="0.5cm" margin-bottom="1.5cm"/ fo:region-before extent="0cm"/ fo:region-after extent="0.5cm"/ /fo:simple-page-master /fo:layout-master-set !-- END OF LAYOUT-MASTER-SET -- fo:page-sequence master-reference="anypage" fo:flow flow-name="xsl-region-body" xsl:apply-templates select="REPORT_NAME"/ xsl:apply-templates select="CREATED_BY"/ xsl:for-each select="FUND_GROUP" fo:table table-omit-header-at-break="false" table-layout="fixed" fo:table-header fo:table-row fo:table-cell border-collapse="collapse" number-columns-spanned="11" fo:block font-size="12pt" text-align="left" font-family="Helvetica" space-after="0pt" font-weight="bold" xsl:choose
Javadoc for org.apache.fop.apps.*
Title: Javadoc for org.apache.fop.apps.* Hello, Where can I see javadoc for org.apache.fop.apps.* Thanks IL
FOP performance - frustrating.. help!!
Hello, I'm getting a little frustrated with FOP performance. We are generating an XML on the fly that contains a few tables with about 1,000 rows in total. We passdown this XML along with XSL to the transformer to generate PDF from our servlet. (transformer.transform( inXML, new SAXResult( driver.getContentHandler())); ) It works well, but it works slow. It takes about 5 minutes for 1,000 rows and this is only for transformer translation (excluing any data query time or jdom XML building time) I read through past emails/FAQs and I think I tried them all and it still does not improve the performance... Please help!! Here is what I have done. 1) run with more memory - yes I tried with 512MB (I don't get OutOfMemory error) 2) run in separate VM - only helps other requests coming to the site 3) try with the latest FOP - I did - mine is fop-0.20.4 4) try with the latest xalan.jar and xerces.jar - tried them, but no improvement 5) cache XSL style sheet - didn't really help... 6) use multiple page-sequence - got it to work and I don't get OutOfMemeory exception, but still performance didn't get better. (even if I break them into multiple page-sequences, I will still have to read through one row at a time, right? - that's why performance is not really improving..) 7) no forward-reference - I don't have any page numbers 8) try with new JDK - trying with JDK 1.3 9) seralize servlet request - haven't done this, but I doubt this will have any performance impact (I'm testing with one request for now) 10) no images - I don't have any... 11) Don't make the XML tree too deep - mine is very flat with 2 levels deep. I have 1,000 rows and each row looks something like following in XML ROW TA_FUND_CODE539/TA_FUND_CODE LONG_NAMESome Fund/LONG_NAME DAILY_FACTOR0.376/DAILY_FACTOR SHORT_RATE_365NA/SHORT_RATE_365 LONG_RATE_365NA/LONG_RATE_365 RATE_360NA/RATE_360 CURR_7_DAY_YIELDNA/CURR_7_DAY_YIELD SEVEN_DAY_EFF_YIELD1.4/SEVEN_DAY_EFF_YIELD AVG_30_DAY_RATE1.58000/AVG_30_DAY_RATE PRICE1./PRICE RATE_DATE09 Dec 2002/RATE_DATE CURRENCYUSD/CURRENCY STATUSI/STATUS /ROW Here is the question: Is this normal to take this long - 5 minutes - to produce a few tables with combined total 1,000 rows (about 30 pages)? Any other better way? Thank you for your suggestions. Regards, IL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FOP vs DRE
Does anybody have any experience with IBM DRE? In terms of performance, which one would perform better? Thanks IL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
page-sequence
1) Could somebody please share any sample xsl that would allow me to create multiple page-sequence? I have multiple tables with combined over 1,000 rows and I understand that I need to use multiple page-sequence per page to free up memory 2) I'm not doing any 'page x of y' stuff, is there any other way to improve the speed? Currently it takes over 5 minutes for 1,000 rows Thanks much. IL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]