0.20.5 XP and SVG
I'm trying to output an SVG image as an fo:external-graphic. I'm getting the following: Exception in thread main java.lang.NoSuchMethodError: org.apache.batik.bridge. UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/ Element;)Lorg/apache/batik/util/UnitProcessor$Context; at org.apache.fop.image.analyser.SVGReader.loadImage(SVGReader.java:107) at org.apache.fop.image.analyser.SVGReader.verifySignature(SVGReader.jav a:85) at org.apache.fop.image.analyser.ImageReaderFactory.Make(ImageReaderFact ory.java:129) at org.apache.fop.image.FopImageFactory.Make(FopImageFactory.java:181) at org.apache.fop.fo.flow.ExternalGraphic.layout(ExternalGraphic.java:18 8) Is this a classpath problem, is it not finding the image, or is it something else? Peter --- [This E-mail has been scanned for viruses but it is your responsibility to maintain up to date anti virus software on the device that you are currently using to read this email. ] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.20.5 XP and SVG
Make sure you're using the Batik version that comes with FOP 0.20.5. Newer versions of Batik have a backwards-incompatible change in the API. The alternative is to use the maintenance branch [1] where the necessary adjustments have been made. [1] http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain/ On 07.12.2005 11:27:04 Peter B. West wrote: I'm trying to output an SVG image as an fo:external-graphic. I'm getting the following: Exception in thread main java.lang.NoSuchMethodError: org.apache.batik.bridge. UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/ Element;)Lorg/apache/batik/util/UnitProcessor$Context; at org.apache.fop.image.analyser.SVGReader.loadImage(SVGReader.java:107) at org.apache.fop.image.analyser.SVGReader.verifySignature(SVGReader.jav a:85) at org.apache.fop.image.analyser.ImageReaderFactory.Make(ImageReaderFact ory.java:129) at org.apache.fop.image.FopImageFactory.Make(FopImageFactory.java:181) at org.apache.fop.fo.flow.ExternalGraphic.layout(ExternalGraphic.java:18 8) Is this a classpath problem, is it not finding the image, or is it something else? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.20.5 XP and SVG
Jeremias Maerki wrote: Make sure you're using the Batik version that comes with FOP 0.20.5. Newer versions of Batik have a backwards-incompatible change in the API. The alternative is to use the maintenance branch [1] where the necessary adjustments have been made. [1] http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain/ On 07.12.2005 11:27:04 Peter B. West wrote: I'm trying to output an SVG image as an fo:external-graphic. I'm getting the following: Exception in thread main java.lang.NoSuchMethodError: org.apache.batik.bridge. UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/ Element;)Lorg/apache/batik/util/UnitProcessor$Context; at org.apache.fop.image.analyser.SVGReader.loadImage(SVGReader.java:107) at org.apache.fop.image.analyser.SVGReader.verifySignature(SVGReader.jav a:85) at org.apache.fop.image.analyser.ImageReaderFactory.Make(ImageReaderFact ory.java:129) at org.apache.fop.image.FopImageFactory.Make(FopImageFactory.java:181) at org.apache.fop.fo.flow.ExternalGraphic.layout(ExternalGraphic.java:18 8) Is this a classpath problem, is it not finding the image, or is it something else? Hi Jeremias, As far as I can tell, I'm using a standard 0.20.5 distribution. The script I'm using is calling the fop.bat script, and the classpath includes the lib/batik.jar from 0.20.5. ??? Peter --- [This E-mail has been scanned for viruses but it is your responsibility to maintain up to date anti virus software on the device that you are currently using to read this email. ] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.20.5 XP and SVG
Peter B. West wrote: Jeremias Maerki wrote: Make sure you're using the Batik version that comes with FOP 0.20.5. Newer versions of Batik have a backwards-incompatible change in the API. The alternative is to use the maintenance branch [1] where the necessary adjustments have been made. [1] http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain/ On 07.12.2005 11:27:04 Peter B. West wrote: I'm trying to output an SVG image as an fo:external-graphic. I'm getting the following: Exception in thread main java.lang.NoSuchMethodError: org.apache.batik.bridge. UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/ Element;)Lorg/apache/batik/util/UnitProcessor$Context; at org.apache.fop.image.analyser.SVGReader.loadImage(SVGReader.java:107) at org.apache.fop.image.analyser.SVGReader.verifySignature(SVGReader.jav a:85) at org.apache.fop.image.analyser.ImageReaderFactory.Make(ImageReaderFact ory.java:129) at org.apache.fop.image.FopImageFactory.Make(FopImageFactory.java:181) at org.apache.fop.fo.flow.ExternalGraphic.layout(ExternalGraphic.java:18 8) Is this a classpath problem, is it not finding the image, or is it something else? Hi Jeremias, As far as I can tell, I'm using a standard 0.20.5 distribution. The script I'm using is calling the fop.bat script, and the classpath includes the lib/batik.jar from 0.20.5. ??? Peter There is a local habit of dropping every jar that comes along into jre/lib/ext, including batik 1.6. That will be the problem. Peter --- [This E-mail has been scanned for viruses but it is your responsibility to maintain up to date anti virus software on the device that you are currently using to read this email. ] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excel format
We currently do this in our production system using SpreadsheetML and HTML. We use SpreadsheetML for newer versions of Excel and HTML with some proprietary MS XML for Excel for Win2K or lower. The process is as follows: 1. Generate your XML data file and parse it using the parser of your choice (i.e. Xerces). 2. Use a transformer and a stylesheet you create to convert your XML into one of the aforementioned spreadsheet formats. We use Xalan for this part. The stylesheet was pretty simple to put together. FOP is not needed for this. I put the entire thing together in about two days so it isn't a big deal. However, there are some gotchas between the two formats that will drive you crazy so be careful. -Lou ~~ LOG-NET, Inc. The Logistics Network Management System ~~ 230 Half Mile Road Third Floor Red Bank, NJ 07701 PH: 732-758-6800 FAX: 732-747-7497 http://www.LOG-NET.com ~~ CONFIDENTIAL PRIVILEGED Unless otherwise indicated or if obvious from the nature of the content, the information contained herein is privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. If the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by telephone (732-758-6800) or by electronic mail ([EMAIL PROTECTED]), and destroy any copies, electronic, paper or otherwise, which you may have of this communication. Thank you. ~~ Farid Adhami [EMAIL PROTECTED] wrote on 12/06/2005 18:56:42: I’m trying to use FOP as report engine. But I have to provide excel format for the report. I didn’t find any information showing that FOP provides Excel output or anyway that could be used for this purpose. Thanks for any help, in advance. Farid
Re: Excel format
On 12/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: We currently do this in our production system using SpreadsheetML and HTML. We use SpreadsheetML for newer versions of Excel and HTML with some proprietary MS XML for Excel for Win2K or lower. The process is as follows: 1. Generate your XML data file and parse it using the parser of your choice (i.e. Xerces). 2. Use a transformer and a stylesheet you create to convert your XML into one of the aforementioned spreadsheet formats. We use Xalan for this part. The stylesheet was pretty simple to put together. FOP is not needed for this. I put the entire thing together in about two days so it isn't a big deal. However, there are some gotchas between the two formats that will drive you crazy so be careful. Would one of those gotchas be that the Excel XML format skips empty cells? -- Craig McDaniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Sequences
Andreas, Thanx for your reply. Yes I do want to ultimately make it look like it did when I just dumped the entire report body under one page sequence, however I cannot use one page sequence due to memory overflow issues. I'm still a little concerned as to why I'm having memory overflow if it is the norm to use one page sequence for the report body as I've done. As for my stylesheet, I'm not offended at all from your comments rather I'm just not as concerned on that part of it. The end result would be the same no matter what technique I used in XSLT and the performance of the stylesheet is acceptible when I use Xalan directly to produce FO. The only big question here is, Can I get away with using one page sequence or do I have to use multiple page sequences? Another equally big question is, How do I go about using multiple page sequences effectively if I have no other option? On Tuesday 06 December 2005 4:07 pm, Andreas L Delmelle wrote: Here's a brief synopsis of how things work. A group of Java classes run multiple queries to pull data from the db and into a result set. Some more Java code transforms the data into XML (sort of an intermediate form for the report). my stylesheet then takes the resultset tranformed into XML and transforms it again into FO for the FOP engine. The data can be voluminous and we are looking into streamlining the process. My major bottleneck now has been the stylesheet creating FO that appears to be choking the FO engine. In a perfect world I'd love to just dump the report in one page sequence element and have the engine sort it out but it doesn't appear to work well that way. So IIC, you need to make it look like it had all been placed under one page-sequence. (more or less: only the very last page in the document can be filled partly, but the rest needs to appear as if it were one fo:flow in one fo:page-sequence). Is that a correct assessment? Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Clifton C. Craig, Software Engineer [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to pass input of xml tranfs. to xslt transf. ?
Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation to the XSLTInputHandler. My code uses a static xsl document and dynamic xml documents. For demonstration purposes I create the xml file on the local filesystem but that'S not very good for my webapplication :o/ Here the code: File xmlfile = new File(session.getServletContext().getRealPath(/xml/), nbw.xml); OutputStream out = new java.io.FileOutputStream(xmlfile); StreamResult streamResult = new StreamResult(out); SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); TransformerHandler hd = tf.newTransformerHandler(); Transformer serializer = hd.getTransformer(); serializer.setOutputProperty(OutputKeys.ENCODING, ISO-8859-1); serializer.setOutputProperty(OutputKeys.INDENT, yes); hd.setResult(streamResult); //Custom transformation with SAX XmlTransformer xmlt = new XmlTransformer(hd); String xslParam = session.getServletContext().getRealPath(/xml/nbw.xsl); String xmlParam = session.getServletContext().getRealPath(/xml/nbw.xml); File xmlFile = new File(xmlParam); //XSLT Transformation XSLTInputHandler input = new XSLTInputHandler(xmlFile, new File((xslParam))); renderXML(input, response); cheers, Pete -- Telefonieren Sie schon oder sparen Sie noch? NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass input of xml tranfs. to xslt transf. ?
Don't use XSLTInputHandler. Use JAXP[1] instead. Glen [1] http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#examples [EMAIL PROTECTED] wrote: Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation to the XSLTInputHandler. My code uses a static xsl document and dynamic xml documents. For demonstration purposes I create the xml file on the local filesystem but that'S not very good for my webapplication :o/ Here the code: File xmlfile = new File(session.getServletContext().getRealPath(/xml/), nbw.xml); OutputStream out = new java.io.FileOutputStream(xmlfile); StreamResult streamResult = new StreamResult(out); SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); TransformerHandler hd = tf.newTransformerHandler(); Transformer serializer = hd.getTransformer(); serializer.setOutputProperty(OutputKeys.ENCODING, ISO-8859-1); serializer.setOutputProperty(OutputKeys.INDENT, yes); hd.setResult(streamResult); //Custom transformation with SAX XmlTransformer xmlt = new XmlTransformer(hd); String xslParam = session.getServletContext().getRealPath(/xml/nbw.xsl); String xmlParam = session.getServletContext().getRealPath(/xml/nbw.xml); File xmlFile = new File(xmlParam); //XSLT Transformation XSLTInputHandler input = new XSLTInputHandler(xmlFile, new File((xslParam))); renderXML(input, response); cheers, Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSLTC template problem
xsl:template match=/ ... fo:page-sequence ... xsl:apply-templates select=whatever-nodes / /fo:page-sequence /xsl:template xsl:template match=whatever-nodes fo:table ... !-- maybe some more xsl:apply-templates or xsl:call-template here... -- /fo:table /xsl:template Yeah, but the problem I had with that was always that it complains that the fo in fo:table inside the whatever temoplate is not bound. (The prefix fo for element fo:table is not bound., 'Could not compile stylesheet') But then I noticed that the xmlns:fo= declaration was inside the fo:root node. I moved it, it works . Sorry for taking up your time with this. I should have seen that ages ago. /Johan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Sequences
On Dec 7, 2005, at 16:12, Clifton Craig wrote: Hi, Thanx for your reply. Yes I do want to ultimately make it look like it did when I just dumped the entire report body under one page sequence, however I cannot use one page sequence due to memory overflow issues. I'm still a little concerned as to why I'm having memory overflow if it is the norm to use one page sequence for the report body as I've done. The explanation for the excessive memory use, AFAIU, is that the Table object holds a list with references to its childNodes, and every childNode again has such a list, etc. As long as the Table is referenced, *all* of its descendant nodes will remain referenced, so if you have a large table with about 20 columns and 1000 rows, and the contents of the cells are plain simple blocks, then keeping this table together in one page-sequence, possibly means 2 cells in memory plus *all* nodes for their content (so, a minimum of 2 blocks and *all* their character data) Given that FOs by definition are compound objects (and not all their members are primitive types), you can try to do the math... and that is only the FO-tree side. Since the handles to the FOs are released only at the end of each page-sequence, splitting the table over multiple page-sequences is currently the only way to keep it manageable. (in both versions of FOP) (Side-note: somehow it should be possible to release the objects for the cells and their content once we're absolutely certain that they will no longer be needed. Determining that, however, doesn't seem to be as simple as it sounds, since layout may involve backtracking several rows...) As for my stylesheet, I'm not offended at all from your comments rather I'm just not as concerned on that part of it. The end result would be the same no matter what technique I used in XSLT and the performance of the stylesheet is acceptible when I use Xalan directly to produce FO. OK, my remarks were related more to style than efficiency. In your case, I'm guessing there is no noticeable performance benefit to my suggestions... It just 'rhymes' better with the XSLT way of doing things (apply templates to node-sets). The only big question here is, Can I get away with using one page sequence or do I have to use multiple page sequences? Oh, you *can* get away with using one page-sequence, but only if you have a massive heap at your disposal... Another equally big question is, How do I go about using multiple page sequences effectively if I have no other option? Well, you mentioned line-counting. How do you go about that exactly? Does this number of lines correspond to a number of elements in your source XML? In that case, you're probably best off using XSLT grouping techniques[*]. If you know in advance how many rows will fit on a page, you could even create one page-sequence per page (one table per page), which should reduce the memory consumption drastically. [*] see: http://www.jenitennison.com/xslt/grouping/index.xml HTH! Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass input of xml tranfs. to xslt transf. ?
Hi Glenn did you mean this example? Taken from [1]. Does this work in a webapp? //Setup output OutputStream out = new java.io.FileOutputStream(pdf); try { driver.setOutputStream(out); //Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xslt)); //Setup input for XSLT transformation Source src = team.getSourceForProjectTeam(); //Resulting SAX events (the generated FO) must be piped through to FOP Result res = new SAXResult(driver.getContentHandler()); //Start XSLT transformation and FOP processing transformer.transform(src, res); [1]http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/tags/fop-0_20_5/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup cheers, Pete --- Ursprüngliche Nachricht --- Von: Glen Mazza [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs. to xslt transf. ? Datum: Wed, 07 Dec 2005 12:41:24 -0500 Don't use XSLTInputHandler. Use JAXP[1] instead. Glen [1] http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#examples [EMAIL PROTECTED] wrote: Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation to the XSLTInputHandler. My code uses a static xsl document and dynamic xml documents. For demonstration purposes I create the xml file on the local filesystem but that'S not very good for my webapplication :o/ Here the code: File xmlfile = new File(session.getServletContext().getRealPath(/xml/), nbw.xml); OutputStream out = new java.io.FileOutputStream(xmlfile); StreamResult streamResult = new StreamResult(out); SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); TransformerHandler hd = tf.newTransformerHandler(); Transformer serializer = hd.getTransformer(); serializer.setOutputProperty(OutputKeys.ENCODING, ISO-8859-1); serializer.setOutputProperty(OutputKeys.INDENT, yes); hd.setResult(streamResult); //Custom transformation with SAX XmlTransformer xmlt = new XmlTransformer(hd); String xslParam = session.getServletContext().getRealPath(/xml/nbw.xsl); String xmlParam = session.getServletContext().getRealPath(/xml/nbw.xml); File xmlFile = new File(xmlParam); //XSLT Transformation XSLTInputHandler input = new XSLTInputHandler(xmlFile, new File((xslParam))); renderXML(input, response); cheers, Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- 10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail +++ GMX - die erste Adresse für Mail, Message, More +++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass input of xml tranfs. to xslt transf. ?
Yes, that's basically it, though ExampleObj2PDF is a bit special. ExampleXML2PDF is the more generic example. And yes, it works in a webapp. On 07.12.2005 21:39:58 Peter.Neu wrote: Hi Glenn did you mean this example? Taken from [1]. Does this work in a webapp? //Setup output OutputStream out = new java.io.FileOutputStream(pdf); try { driver.setOutputStream(out); //Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xslt)); //Setup input for XSLT transformation Source src = team.getSourceForProjectTeam(); //Resulting SAX events (the generated FO) must be piped through to FOP Result res = new SAXResult(driver.getContentHandler()); //Start XSLT transformation and FOP processing transformer.transform(src, res); [1]http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/tags/fop-0_20_5/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup cheers, Pete --- Ursprüngliche Nachricht --- Von: Glen Mazza [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs. to xslt transf. ? Datum: Wed, 07 Dec 2005 12:41:24 -0500 Don't use XSLTInputHandler. Use JAXP[1] instead. Glen [1] http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#examples [EMAIL PROTECTED] wrote: Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation to the XSLTInputHandler. My code uses a static xsl document and dynamic xml documents. For demonstration purposes I create the xml file on the local filesystem but that'S not very good for my webapplication :o/ Here the code: File xmlfile = new File(session.getServletContext().getRealPath(/xml/), nbw.xml); OutputStream out = new java.io.FileOutputStream(xmlfile); StreamResult streamResult = new StreamResult(out); SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); TransformerHandler hd = tf.newTransformerHandler(); Transformer serializer = hd.getTransformer(); serializer.setOutputProperty(OutputKeys.ENCODING, ISO-8859-1); serializer.setOutputProperty(OutputKeys.INDENT, yes); hd.setResult(streamResult); //Custom transformation with SAX XmlTransformer xmlt = new XmlTransformer(hd); String xslParam = session.getServletContext().getRealPath(/xml/nbw.xsl); String xmlParam = session.getServletContext().getRealPath(/xml/nbw.xml); File xmlFile = new File(xmlParam); //XSLT Transformation XSLTInputHandler input = new XSLTInputHandler(xmlFile, new File((xslParam))); renderXML(input, response); cheers, Pete Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Q: How to define a minimal table length?
Sander, Stefan wrote: I want to create a table layout that displays my data nicely in several columns and over several pages (if necessary) - no problem so far. But the table should always end at the bottom of a page, so that the table footer is always displayed at the same position, even if there is just not enough data to fill the page. I'd try to put the footer content into a region-after rather than a table footer. If necessary, use a marker in the last table cell for providing the content. A footnote in the last table cell may also a solution. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Q: How to define a minimal table length?
Depending on your layout requirements you can make sure that all your rows have the same height. You can use the height property for that, or even better, the block-progression-dimension property, though that's only available in FOP 0.90alpha1. If you have differing row heights you're probably a little out of luck. For one, XSL-FO doesn't allow to vertically distribute content as it's possible with text-align=justify, though there's some code in FOP 0.90 that allows to create that effect. But without having checked it I doubt it will work with tables. Tables are somewhat special and currently can't have adjustable heights. You might be able to use a trick by using the region-after as footer for the table. Without knowing more about your requirements it's a little difficult to give any more hints, but maybe the above already helps a little. Maybe someone else has additional ideas. On 07.12.2005 13:08:14 Sander, Stefan wrote: Hello, it has been a while since I last worked with FOP (about three years maybe), but this week I am back at it again... and here comes my problem: I want to create a table layout that displays my data nicely in several columns and over several pages (if necessary) - no problem so far. But the table should always end at the bottom of a page, so that the table footer is always displayed at the same position, even if there is just not enough data to fill the page. Any suggestions how i can achieve this? Thanks a lot, Stefan Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass input of xml tranfs. to xslt transf. ?
[EMAIL PROTECTED] wrote: did you mean this example? Yes. Does this work in a webapp? Yes. You have to use a ByteArrayOutputStream as a buffer to set the content length HTTP header correctly (there are many code samples on the net for this detail). Why do do think it might not work? J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Sequences
On Wednesday 07 December 2005 3:46 pm, J.Pietschmann wrote: Clifton Craig wrote: I'm still a little concerned as to why I'm having memory overflow if it is the norm to use one page sequence for the report body as I've done. Tables lock up objects used for content formatting for too long, they are released (together with objects representing the FO) at the end of a page sequence only. Using multiple page sequences releases memory earlier. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] J, So the only time tables are realeased are at the end of a page sequence? That would explain my dilemma. Even though I use multiple smaller tables per row instead of one big table all of the smaller tables are held until the page sequence ends? That sux. -- Clifton C. Craig, Software Engineer [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
group-by
This may be slightly off topic but maybe someone could help me out. I am confused about the group-by XSL functionality xsl:for-each-group select=xmlReportOutput/reportOutput/records/record group-by=saxon:evaluate($sortColumn1) xsl:sort select=saxon:evaluate($sortColumn1) order={$sortColumn1Order}/ xsl:variable name=group1 select=current-grouping-key()/ xsl:call-template name=RenderByDesk xsl:with-param name=tradeType select=$group1/ /xsl:call-template /xsl:for-each-group However the values in $sortColumn1 has 4 different possibilities lets say A, B, C, D and I need some logic that groups all As into one group and everything else into another group ( A = group1 -- B,C,D = group2 ) . Is there an easy way to do that? * This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass input of xml tranfs. to xslt transf. ?
Pete, I see. No, in this case you're not missing anything although you may not need to rewrite your whole code just to accomodate the new pattern. Generating XML using SAX events is one way to generate XML, a good way but not necessarily the only one. Remember that JAXP is quite flexible and that you could use a DOMSource, for example, if you've already got code that generates a DOM from your data. The purpose of the examples in the examples/embedding directory are to show a gradual approach to the patterns that we suggest people use. The benefit out of this is a flexible and quick solution. On 08.12.2005 08:20:49 Peter.Neu wrote: Hi Jeremias, I was refering to Obj2PDF because this is the only example which shows how to generate XML and then pass it to the FOP Transformation. XML2PDF works with a static and already existing xml file. So the whole point was how to pass a generated xml file to fop without writing it to the file system. Using the Obj2PDF requires a lot of refactoring in my code but that is the only option I got I suppose, or am I missing something? cheers, Pete --- Ursprüngliche Nachricht --- Von: Jeremias Maerki [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs. to xslt transf. ? Datum: Wed, 07 Dec 2005 21:44:38 +0100 Yes, that's basically it, though ExampleObj2PDF is a bit special. ExampleXML2PDF is the more generic example. And yes, it works in a webapp. On 07.12.2005 21:39:58 Peter.Neu wrote: Hi Glenn did you mean this example? Taken from [1]. Does this work in a webapp? //Setup output OutputStream out = new java.io.FileOutputStream(pdf); try { driver.setOutputStream(out); //Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xslt)); //Setup input for XSLT transformation Source src = team.getSourceForProjectTeam(); //Resulting SAX events (the generated FO) must be piped through to FOP Result res = new SAXResult(driver.getContentHandler()); //Start XSLT transformation and FOP processing transformer.transform(src, res); [1]http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/tags/fop-0_20_5/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup cheers, Pete --- Ursprüngliche Nachricht --- Von: Glen Mazza [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs. to xslt transf. ? Datum: Wed, 07 Dec 2005 12:41:24 -0500 Don't use XSLTInputHandler. Use JAXP[1] instead. Glen [1] http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#examples [EMAIL PROTECTED] wrote: Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation to the XSLTInputHandler. My code uses a static xsl document and dynamic xml documents. For demonstration purposes I create the xml file on the local filesystem but that'S not very good for my webapplication :o/ Here the code: File xmlfile = new File(session.getServletContext().getRealPath(/xml/), nbw.xml); OutputStream out = new java.io.FileOutputStream(xmlfile); StreamResult streamResult = new StreamResult(out); SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); TransformerHandler hd = tf.newTransformerHandler(); Transformer serializer = hd.getTransformer(); serializer.setOutputProperty(OutputKeys.ENCODING, ISO-8859-1); serializer.setOutputProperty(OutputKeys.INDENT, yes); hd.setResult(streamResult); //Custom transformation with SAX XmlTransformer xmlt = new XmlTransformer(hd); String xslParam = session.getServletContext().getRealPath(/xml/nbw.xsl); String xmlParam = session.getServletContext().getRealPath(/xml/nbw.xml); File xmlFile = new File(xmlParam); //XSLT Transformation XSLTInputHandler input = new XSLTInputHandler(xmlFile, new File((xslParam))); renderXML(input, response); cheers, Pete Jeremias Maerki Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass input of xml tranfs. to xslt transf. ?
Hello Jeremias, good your are in the cet time zone,too ;o). My code also uses sax so the refactoring process will not be that long. Anyway it's always good to have a working example so I'll adapt to that. I'll be back with details when I'm done refactoring. cheers, Pete --- Ursprüngliche Nachricht --- Von: Jeremias Maerki [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs. to xslt transf. ? Datum: Thu, 08 Dec 2005 08:32:55 +0100 Pete, I see. No, in this case you're not missing anything although you may not need to rewrite your whole code just to accomodate the new pattern. Generating XML using SAX events is one way to generate XML, a good way but not necessarily the only one. Remember that JAXP is quite flexible and that you could use a DOMSource, for example, if you've already got code that generates a DOM from your data. The purpose of the examples in the examples/embedding directory are to show a gradual approach to the patterns that we suggest people use. The benefit out of this is a flexible and quick solution. On 08.12.2005 08:20:49 Peter.Neu wrote: Hi Jeremias, I was refering to Obj2PDF because this is the only example which shows how to generate XML and then pass it to the FOP Transformation. XML2PDF works with a static and already existing xml file. So the whole point was how to pass a generated xml file to fop without writing it to the file system. Using the Obj2PDF requires a lot of refactoring in my code but that is the only option I got I suppose, or am I missing something? cheers, Pete --- Ursprüngliche Nachricht --- Von: Jeremias Maerki [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs. to xslt transf. ? Datum: Wed, 07 Dec 2005 21:44:38 +0100 Yes, that's basically it, though ExampleObj2PDF is a bit special. ExampleXML2PDF is the more generic example. And yes, it works in a webapp. On 07.12.2005 21:39:58 Peter.Neu wrote: Hi Glenn did you mean this example? Taken from [1]. Does this work in a webapp? //Setup output OutputStream out = new java.io.FileOutputStream(pdf); try { driver.setOutputStream(out); //Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xslt)); //Setup input for XSLT transformation Source src = team.getSourceForProjectTeam(); //Resulting SAX events (the generated FO) must be piped through to FOP Result res = new SAXResult(driver.getContentHandler()); //Start XSLT transformation and FOP processing transformer.transform(src, res); [1]http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/tags/fop-0_20_5/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup cheers, Pete --- Ursprüngliche Nachricht --- Von: Glen Mazza [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs. to xslt transf. ? Datum: Wed, 07 Dec 2005 12:41:24 -0500 Don't use XSLTInputHandler. Use JAXP[1] instead. Glen [1] http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#examples [EMAIL PROTECTED] wrote: Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation to the XSLTInputHandler. My code uses a static xsl document and dynamic xml documents. For demonstration purposes I create the xml file on the local filesystem but that'S not very good for my webapplication :o/ Here the code: File xmlfile = new File(session.getServletContext().getRealPath(/xml/), nbw.xml); OutputStream out = new java.io.FileOutputStream(xmlfile); StreamResult streamResult = new StreamResult(out); SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); TransformerHandler hd = tf.newTransformerHandler(); Transformer serializer = hd.getTransformer(); serializer.setOutputProperty(OutputKeys.ENCODING, ISO-8859-1); serializer.setOutputProperty(OutputKeys.INDENT, yes); hd.setResult(streamResult); //Custom transformation with SAX XmlTransformer xmlt = new XmlTransformer(hd); String xslParam = session.getServletContext().getRealPath(/xml/nbw.xsl); String xmlParam = session.getServletContext().getRealPath(/xml/nbw.xml); File xmlFile = new File(xmlParam); //XSLT Transformation XSLTInputHandler input = new XSLTInputHandler(xmlFile, new File((xslParam))); renderXML(input, response);