DO NOT REPLY [Bug 47953] New: NullPointerException in AFPRendererConfigurator
https://issues.apache.org/bugzilla/show_bug.cgi?id=47953 Summary: NullPointerException in AFPRendererConfigurator Product: Fop Version: all Platform: Other OS/Version: Windows Vista Status: NEW Severity: blocker Priority: P2 Component: fonts AssignedTo: fop-dev@xmlgraphics.apache.org ReportedBy: vanukuri.ven...@googlemail.com When I try to generate AFP output file from Simple FO, I am getting the following error: 07-Oct-2009 10:31:03 org.apache.fop.cli.Main startFOP SEVERE: Exception java.lang.NullPointerException at org.apache.fop.render.afp.AFPRendererConfigurator.buildFontListFromConfiguration(AFPRendererConfigurator.java:269) at org.apache.fop.render.afp.AFPRendererConfigurator.configure(AFPRendererConfigurator.java:301) at org.apache.fop.render.RendererFactory.tryRendererMaker(RendererFactory.java:304) at org.apache.fop.render.RendererFactory.createRenderer(RendererFactory.java:264) at org.apache.fop.area.RenderPagesModel.init(RenderPagesModel.java:69) at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:130) at org.apache.fop.area.AreaTreeHandler.init(AreaTreeHandler.java:102) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:359) at org.apache.fop.fo.FOTreeBuilder.init(FOTreeBuilder.java:105) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:100) at org.apache.fop.apps.Fop.init(Fop.java:78) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:253) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:107) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 47953] NullPointerException in AFPRendererConfigurator
https://issues.apache.org/bugzilla/show_bug.cgi?id=47953 Venkat Reddy vanukuri.ven...@googlemail.com changed: What|Removed |Added CC||vanukuri.ven...@googlemail. ||com -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 47953] NullPointerException in AFPRendererConfigurator
https://issues.apache.org/bugzilla/show_bug.cgi?id=47953 --- Comment #1 from Venkat Reddy vanukuri.ven...@googlemail.com 2009-10-07 03:01:58 PDT --- This bug is happening only for AFPRenderer, AFPPainter is working properly. I have used the following command at the command prompt: fop -c C:\foptest\fop.xconf -fo C:\foptest\pageoverlay.fo -afp C:\foptest\pageoverlay.afp I have used the prefer-renderertrue/prefer-renderer in my fop configuration file to force the render instead of painter please find the FO file attached to this bug. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 47953] NullPointerException in AFPRendererConfigurator
https://issues.apache.org/bugzilla/show_bug.cgi?id=47953 --- Comment #2 from Venkat Reddy vanukuri.ven...@googlemail.com 2009-10-07 03:03:38 PDT --- Created an attachment (id=24354) -- (https://issues.apache.org/bugzilla/attachment.cgi?id=24354) This is a simple page overlay sample fo file -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 47941] AFP Renderer Truncates TLE Values
https://issues.apache.org/bugzilla/show_bug.cgi?id=47941 --- Comment #1 from Venkat Reddy vanukuri.ven...@googlemail.com 2009-10-07 03:18:28 PDT --- Hi Chris, Can you please attach the XSL-FO file you used for this test case? Thanks, Venkat. (In reply to comment #0) 2 of the longer TLE Values in attached XSL-FO File are truncated by AFP Renderer. Apecifically the TLEs with name JES0 and ACC1 are truncated using a recent revision of FOP trunk. I can't see any specific limit for TLE records in the MO:DCA specification. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
Re: Regular expression use
Hi Jonathan, Jonathan Levinson wrote: I noticed that if one is not careful in one's regular expression use, the compilation for a regular expression can take minutes. I'm not talking about applying the pattern just compiling it! Should regular expressions be avoided altogether and should one use hand-crafted state machines for parsing, and tokenizing, or can regular expressions be used as long as one is careful? I’d say, use regular expressions as long as they are not too complex. But I guess you’re mentioning that in the context of property parsing, in which case I don’t think regular expressions are the ultimate answer. A proper lexer is likely to be needed, either generated or written by hand. As the latter solution quickly becomes a maintenance nightmare, some lexer generator will probably be needed. Question remains, which one, and I’m not even sure there’s one that exists whose license is ASLv2-compatible. Plus there are some issues specific to property parsing, like shorthands (which should ideally re-use the parsers of the individual properties), sub-properties, etc. Vincent
NPE when using non-base14 font via IF XML
Hi, If I render the attached FO file into IF XML with the attached configuration file, then render the xml file into PDF, then I get the following error: SEVERE: Exception java.lang.NullPointerException: fontName must not be null at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:239) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: java.lang.NullPointerException: fontName must not be null at org.apache.fop.render.pdf.PDFPainter.getTypeface(PDFPainter.java:246) at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:269) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endElement(IFParser.java:487) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java:277) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:236) ... 3 more To reproduce: put the config file at the root of a FOP local copy, then run the following: fop -c config.xconf test.fo -if if.xml fop -c config.xconf -ifin if.xml test.pdf Did I miss anything? Thanks, Vincent ?xml version=1.0? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=page page-height=220pt page-width=320pt margin=10pt fo:region-body/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=page language=en country=GB fo:flow flow-name=xsl-region-body hyphenate=true text-align=justify font-family=DejaVu fo:blockApache FOP (Formatting Objects Processor) is a print formatter driven by XSL formatting objects (XSL-FO) and an output independent formatter. It is a Java application that reads a formatting object (FO) tree and renders the resulting pages to a specified output./fo:block /fo:flow /fo:page-sequence /fo:root ?xml version=1.0 encoding=UTF-8? fop version=1.0 use-cachefalse/use-cache font-basetest/resources/fonts//font-base renderers renderer mime=application/pdf filterList valuenull/value /filterList filterList type=image valueflate/value valueascii-85/value /filterList fonts font embed-url=DejaVuLGCSerif.ttf font-triplet name=DejaVu style=normal weight=normal/ /font /fonts /renderer renderer mime=application/X-fop-intermediate-format fonts font embed-url=DejaVuLGCSerif.ttf font-triplet name=DejaVu style=normal weight=normal/ /font /fonts /renderer /renderers /fop
Mimic a specific output with the intermediate format [was: Re: NPE when using non-base14 font via IF XML]
While I'm at it, and taking the same FO file and config file: specifying a mime type for the intermediate format doesn’t seem to work, contrary to the area tree. Take the config file, remove the part corresponding to the intermediate format (renderer mime=application/X-fop-intermediate-format), and run the following: fop -c config.xconf test.fo -at application/pdf at.xml fop -c config.xconf -atin at.xml test.pdf That works and the font is correctly embedded. Now run the following: fop -c config.xconf test.fo -if application/pdf if.xml You get the following warning: WARNING: Font DejaVu,normal,400 not found. Substituting with any,normal,400. Hence my adding of the IF part in the config file. Is that normal? Isn’t there an output mimiced by default? Did I miss anything again? Thanks, Vincent
Re: NPE when using non-base14 font via IF XML
Hi Vincent, To reproduce: put the config file at the root of a FOP local copy, then run the following: fop -c config.xconf test.fo -if if.xml fop -c config.xconf -ifin if.xml test.pdf I would like to run your example this way, but there is no fop.sh. Is there such a thing for the Linux guys or should I write one? Best Regards Alex signature.asc Description: This is a digitally signed message part
Re: NPE when using non-base14 font via IF XML
Hi Alexander, Alexander Kiel wrote: Hi Vincent, To reproduce: put the config file at the root of a FOP local copy, then run the following: fop -c config.xconf test.fo -if if.xml fop -c config.xconf -ifin if.xml test.pdf I would like to run your example this way, but there is no fop.sh. Is there such a thing for the Linux guys or should I write one? The script is called just fop. Look at the root of the project, it’s actually a shell script. http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop?view=log Best Regards Alex Vincent
Re: NPE when using non-base14 font via IF XML
Hi Vincent, The script is called just fop. Look at the root of the project, it’s actually a shell script. http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop?view=log oh I was just blind. Thanks. Alex signature.asc Description: This is a digitally signed message part
DO NOT REPLY [Bug 47941] AFP Renderer Truncates TLE Values
https://issues.apache.org/bugzilla/show_bug.cgi?id=47941 --- Comment #2 from Chris Bowditch bowditch_ch...@hotmail.com 2009-10-07 06:47:45 PDT --- Created an attachment (id=24355) -- (https://issues.apache.org/bugzilla/attachment.cgi?id=24355) XSL-FO to reproduce the problem -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 47941] AFP Renderer Truncates TLE Values
https://issues.apache.org/bugzilla/show_bug.cgi?id=47941 --- Comment #3 from Chris Bowditch bowditch_ch...@hotmail.com 2009-10-07 06:48:42 PDT --- Sorry - I seem to be having some problems with Bugzilla and attachments. I did attach the XSL-FO File when I logged the bug but Bugzilla had a problem with the content type and didn't tell me. Grmbl -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 47953] NullPointerException in AFPRendererConfigurator
https://issues.apache.org/bugzilla/show_bug.cgi?id=47953 Jeremias Maerki jerem...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #3 from Jeremias Maerki jerem...@apache.org 2009-10-07 06:55:02 PDT --- Fixed: http://svn.apache.org/viewvc?rev=822742view=rev Thanks for the error report and sorry for the silly mistake. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
Re: NPE when using non-base14 font via IF XML
Alexander, that hints to a buggy XSLT processor. Please replace the Xalan coming with the JVM with the one bundled with FOP. http://xml.apache.org/xalan-j/faq.html#faq-N100EF On 07.10.2009 14:42:52 Alexander Kiel wrote: Hi Vincent, I get a completely different error. If I ran fop -c config.xconf test.fo -if if.xml There is no output - so it seems to run fine. If I run fop -c config.xconf -ifin if.xml test.pdf afterwards, I get: [Fatal Error] if.xml:4:12: The prefix x for element x:xmpmeta is not bound. Oct 7, 2009 2:37:23 PM org.apache.fop.cli.Main startFOP SEVERE: Exception javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:239) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) - javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:469) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:236) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:452) ... 4 more - org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:452) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:236) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) I attached the if.xml. There is indeed no namespace declared for the x prefix. I'm inside a up-to-date trunk. FOP was build with Java 1.4. Best Regards Alex - e-mail: alexanderk...@gmx.net web:www.alexanderkiel.net On Wed, 2009-10-07 at 12:16 +0100, Vincent Hennebert wrote: Hi, If I render the attached FO file into IF XML with the attached configuration file, then render the xml file into PDF, then I get the following error: SEVERE: Exception java.lang.NullPointerException: fontName must not be null at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:239) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: java.lang.NullPointerException: fontName must not be null at org.apache.fop.render.pdf.PDFPainter.getTypeface(PDFPainter.java:246) at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:269) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endElement(IFParser.java:487) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java:277) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:236) ... 3 more To reproduce: put the config file at the root of a FOP local copy, then
Re: NPE when using non-base14 font via IF XML
Hi Jeremias, Alexander, that hints to a buggy XSLT processor. Please replace the Xalan coming with the JVM with the one bundled with FOP. http://xml.apache.org/xalan-j/faq.html#faq-N100EF Thanks for this hint. I just use Java 1.4 not very often. With Java 1.6 it works. Now I see the same NullPointerException. This null fontName comes from line 264 in PDFPainter: String fontKey = getFontInfo().getInternalFontKey(triplet); The JavaDoc of getInternalFontKey() says, it can return null. But there is no null check afterwards. But I have no idea, why the triplet is unknown. Best Regards Alex On 07.10.2009 14:42:52 Alexander Kiel wrote: Hi Vincent, I get a completely different error. If I ran fop -c config.xconf test.fo -if if.xml There is no output - so it seems to run fine. If I run fop -c config.xconf -ifin if.xml test.pdf afterwards, I get: [Fatal Error] if.xml:4:12: The prefix x for element x:xmpmeta is not bound. Oct 7, 2009 2:37:23 PM org.apache.fop.cli.Main startFOP SEVERE: Exception javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:239) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) - javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:469) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:236) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:452) ... 4 more - org.xml.sax.SAXParseException: The prefix x for element x:xmpmeta is not bound. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:452) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:236) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) I attached the if.xml. There is indeed no namespace declared for the x prefix. I'm inside a up-to-date trunk. FOP was build with Java 1.4. Best Regards Alex - e-mail: alexanderk...@gmx.net web:www.alexanderkiel.net On Wed, 2009-10-07 at 12:16 +0100, Vincent Hennebert wrote: Hi, If I render the attached FO file into IF XML with the attached configuration file, then render the xml file into PDF, then I get the following error: SEVERE: Exception java.lang.NullPointerException: fontName must not be null at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:239) at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) Caused by: java.lang.NullPointerException: fontName must not be null at org.apache.fop.render.pdf.PDFPainter.getTypeface(PDFPainter.java:246) at org.apache.fop.render.pdf.PDFPainter.drawText(PDFPainter.java:269) at org.apache.fop.render.intermediate.IFParser$Handler$TextHandler.endElement(IFParser.java:487) at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java:277) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at
Re: Mimic a specific output with the intermediate format [was: Re: NPE when using non-base14 font via IF XML]
Vincent, the -if [mime] out pattern wasn't implemented for the command-line. But I've just done that missing piece: http://svn.apache.org/viewvc?rev=822753view=rev On 07.10.2009 13:27:57 Vincent Hennebert wrote: While I'm at it, and taking the same FO file and config file: specifying a mime type for the intermediate format doesn’t seem to work, contrary to the area tree. Take the config file, remove the part corresponding to the intermediate format (renderer mime=application/X-fop-intermediate-format), and run the following: fop -c config.xconf test.fo -at application/pdf at.xml fop -c config.xconf -atin at.xml test.pdf That works and the font is correctly embedded. Now run the following: fop -c config.xconf test.fo -if application/pdf if.xml You get the following warning: WARNING: Font DejaVu,normal,400 not found. Substituting with any,normal,400. Hence my adding of the IF part in the config file. Is that normal? Isn’t there an output mimiced by default? Did I miss anything again? Thanks, Vincent Jeremias Maerki
RE: Regular expression use
I'm sure someone has mentioned it already but what about the lexer support in ANTLR? http://www.antlr.org/wiki/display/ANTLR3/FAQ+-+Lexical+analysis ANTLR is available under the BSD license, which seems to be one with no strings attached: http://www.antlr.org/license.html Best Regards, Jonathan S. Levinson -Original Message- From: Vincent Hennebert [mailto:vhenneb...@gmail.com] Sent: Wednesday, October 07, 2009 6:51 AM To: fop-dev@xmlgraphics.apache.org Subject: Re: Regular expression use Hi Jonathan, Jonathan Levinson wrote: I noticed that if one is not careful in one's regular expression use, the compilation for a regular expression can take minutes. I'm not talking about applying the pattern just compiling it! Should regular expressions be avoided altogether and should one use hand-crafted state machines for parsing, and tokenizing, or can regular expressions be used as long as one is careful? I’d say, use regular expressions as long as they are not too complex. But I guess you’re mentioning that in the context of property parsing, in which case I don’t think regular expressions are the ultimate answer. A proper lexer is likely to be needed, either generated or written by hand. As the latter solution quickly becomes a maintenance nightmare, some lexer generator will probably be needed. Question remains, which one, and I’m not even sure there’s one that exists whose license is ASLv2-compatible. Plus there are some issues specific to property parsing, like shorthands (which should ideally re-use the parsers of the individual properties), sub-properties, etc. Vincent