How to:fo:block-container left=xsl:value-of select=string-length(text)/
How it is possible?: fo:block-container left=xsl:value-of select=string-length(text)/ help me please -- View this message in context: http://old.nabble.com/How-to%3A%3Cfo%3Ablock-container-left%3D%22%3Cxsl%3Avalue-of--select%3D%22string-length%28text%29%22-%3E%22-tp27295498p27295498.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How to:fo:block-container left=xsl:value-of select=string-length(text)/
On 01/24/2010 03:40 PM, Magdikova wrote: How it is possible?: fo:block-container left=xsl:value-of select=string-length(text)/ help me please You mean: fo:block-container xsl:attribute name=leftxsl:value-of select=string-length(text)//xsl:attribute -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
keep block (header) and list-block (bullets) together in 0.94
Using a two column layout keep-with-next does not appear to do the job. Something like this !-- the header -- fo:block keep-with-next=always xsl:value-of select=text() /fo:block !-- the bullets-- fo:list-block xsl:call-template name=bullets xsl:with-param select=*/ /xsl:call-template /fo:list-block The header is appearing at the bottom of one column and the bullets are starting at the top of the next column. Is this expected behaviour? PS. I'm not at work right now, but I'll try .within-page asap. -- View this message in context: http://old.nabble.com/keep-block-%28header%29-and-list-block-%28bullets%29-together-in-0.94-tp27298843p27298843.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How to:fo:block-container left=xsl:value-of select=string-length(text)/
yes, thank you, but how can I set measurments? like cm or pixel? Sergiu Dumitriu-2 wrote: On 01/24/2010 03:40 PM, Magdikova wrote: How it is possible?: fo:block-container left=xsl:value-of select=string-length(text)/ help me please You mean: fo:block-container xsl:attribute name=leftxsl:value-of select=string-length(text)//xsl:attribute -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/How-to%3A%3Cfo%3Ablock-container-left%3D%22%3Cxsl%3Avalue-of--select%3D%22string-length%28text%29%22-%3E%22-tp27295498p27299637.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How to:fo:block-container left=xsl:value-of select=string-length(text)/
On 24.01.2010 23:09, Magdikova wrote: yes, thank you, but how can I set measurments? like cm or pixel? Either add to the attribute value as text: fo:block-container xsl:attribute name=leftxsl:value-of select=string-length(text)/mm/xsl:attribute ^^ or (easier to read) fo:block-container xsl:attribute name=left xsl:value-of select=string-length(text)/ xsl:textmm/xsl:text /xsl:attribute or use an attribute value template (the braces below) fo:block-container left={string-length(text)}mm In case of further question regarding XSLT, check the XSL FAQ first (and perhaps take a look into Michael Kay's book) http://www.dpawson.co.uk/xsl/ J.Pietschmann - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: XSL caching question
Hi Sean, Thanks for your response. My code basically is what you've suggested. I use static initialisers load the templates in the static block. It seems to be doing it at server startup because of the log messages that gets printed out also by the fact that the templates do get used (doesn't look like it is creating new ones) when the PDF document is generated. BUT the PDF generation is still slower the first time the xsl style sheets are being used. I am thinking of trying out the XSLT compiler as pointed out in http://xmlgraphics.apache.org/fop/0.95/embedding.html#performance My concern is the comment: Although the XSLTC developers make every effort to avoid changes that affect binary compatibility, we cannot guarantee that a translet will work with any version of the run-time processor other than the one that corresponds to the version of the XSLTC compiler that was used to create the translet. in the description on whether any upgrade of java version would have any impact? or would it be just the version of the XSLT compiler? Cheers, Griffin,Sean wrote: Tamu, Based simply on the code sample that Brian provided in his original post over a year ago, the XSL will only be compiled when the class containing that static initializer is loaded. That class won't be loaded until it's used, so your first run is always going to include both compilation and transformation time while subsequent runs will just include transformation. Couple that with the fact that even after compilation there is undoubtedly other caching and potential class loading going on by both the JVM and OS when you do the first transformation. And finally, Brian's original post coupled the XSLT transformation with the FOP rendering; these are separate processes and FOP does not control how you use the XSLT to get to the XSL-FO it needs. Assuming your code is like Brian's, it's doing what it's supposed to do (though I personally don't like static initializers myself because of the exception-eating that goes on if there's an error in the stylesheet that causes it to not compile). If you want to perform the stylesheet compilation before the first run you need to put it in a method that gets called from the lifecycle hooks in your application. Assuming this is in a web application, you can do it in the ServletContextListener.contextInitialized method. Sean -Original Message- From: tamugrg [mailto:sagun.gur...@auspost.com.au] Sent: Friday, January 22, 2010 6:34 AM To: fop-users@xmlgraphics.apache.org Subject: RE: XSL caching question Hi, I am facing exactly the same issue. The first time the XSL gets used, it takes quite a bit of time to do the transformation. After that the transformations happen much faster. I am using templates as described in this thread assume the style sheet should be cached. But from the behaviour that it takes longer the first time the XSLs are being used subsequently takes lesser time indicates that probably it's not been catched. Any suggestions/experience on this is very much appreciated. Cheers, tamu Brian Trezise wrote: Silly me, going to be hard for you guys to answer my question if you don't have a code sample to look at J static { try { cyberTron = TransformerFactory.newInstance(); Config config = (Config) ConfigManager.getInstance().getConfig(Config.class); Source xslt = new StreamSource(new File(config.getXSLTemplateURL())); allSpark = cyberTron.newTemplates(xslt); } catch(Exception e) { logger.error(e); } } ~Brian ___ Brian Trezise Staff Software Engineer IntelliData, Inc 22288 E Princeton Dr aurora, colorado 80018 T: 720.524.4864 brian.trez...@intellidata.net From: Brian Trezise [mailto:brian.trez...@intellidata.net] Sent: Monday, August 25, 2008 2:41 PM To: fop-users@xmlgraphics.apache.org Subject: XSL caching question In FOP 0.95, I'm using the basic caching method to cache my XSL transformation file, not doing anything fancy with file system monitors or anything for the time being. The first time I run FOP on the server to generate a pdf, it takes 10-20 seconds to generate the pdf because it's loading up the XSL file for the first run. Afterwards it runs in the neighborhood of 500ms per PDF. I was just wondering if there is a way to force the XSL to fully cache statically? This isn't a huge issue as we don't restart our servers all that often but it's just a little thing that's bugging me J Thanks, ___ Brian Trezise Staff Software Engineer IntelliData, Inc 22288 E Princeton Dr aurora, colorado 80018 T: 720.524.4864 brian.trez...@intellidata.net -- View this message in context:
Re: How to:fo:block-container left=xsl:value-of select=string-length(text)/
Or just fo:block-container left={string-length(text)}/ Den 24. jan. 2010 kl. 16.39 skrev Sergiu Dumitriu ser...@xwiki.com: On 01/24/2010 03:40 PM, Magdikova wrote: How it is possible?: fo:block-container left=xsl:value-of select=string-length (text)/ help me please You mean: fo:block-container xsl:attribute name=leftxsl:value-of select=string-length (text)//xsl:attribute -- Sergiu Dumitriu http://purl.org/net/sergiu/ - 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
Re: problem with fo:inline and fo:external-graphic, overflows
hello. thx Vincent Hennebert-2, may be i am stupid but i still have a problem:) i use this fo(for example) ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:template match=/ fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=my-page page-height=29.7cm page-width=21cm margin-top=0cm margin-bottom=0cm margin-left=0cm margin-right=0cm fo:region-body column-count=2 margin-top=1.5cm margin-bottom=1.5cm margin-left=1.5cm margin-right=1.5cm / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=my-page fo:flow flow-name=xsl-region-body fo:blocksometext1 fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ st2 fo:external-graphic src=0011.tif content-width=scale-down-to-fit inline-progression-dimension.maximum=100%/ fo:external-graphic src=0011.tif content-width=scale-down-to-fit inline-progression-dimension.maximum=100%/ fo:external-graphic src=0011.tif content-width=scale-down-to-fit inline-progression-dimension.maximum=100%/ st11 fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ sometext2/fo:block /fo:flow /fo:page-sequence /fo:root /xsl:template /xsl:stylesheet Vincent Hennebert-2 wrote: That’s because the width of your image is greater than the page width. when i use fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ 80mm is less then width of my page. but if i use 3 images then yes. so i want one of them move down. Vincent Hennebert-2 wrote: You have to scale it down, for example: fo:external-graphic src=image content-width=scale-down-to-fit inline-progression-dimension.maximum=100%/ i try fo:external-graphic src=0011.tif content-width=scale-down-to-fit inline-progression-dimension.maximum=100%/ but it overflows too! the right part of third image do not display correctly! and i want my image to be width 80mm, not random :) image http://old.nabble.com/file/p27302965/0011.tif 0011.tif fo document http://old.nabble.com/file/p27302965/mystyle.fo mystyle.fo output pdf http://old.nabble.com/file/p27302965/name.pdf name.pdf Vincent Hennebert-2 wrote: Hi, lexa2009 wrote: hi, thx for help. if i use fo:blocksometext1 fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ st2 fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ fo:external-graphic src=0011.tif display-align=center scaling=uniform content-width=80mm/ sometext2/fo:block images still overflow my page. there is an example http://old.nabble.com/file/p27270558/name.pdf name.pdf That’s because the width of your image is greater than the page width. You have to scale it down, for example: fo:external-graphic src=image content-width=scale-down-to-fit inline-progression-dimension.maximum=100%/ HTH, Vincent - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27302965.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org