Hi FOP-Developers, I'm using a xsl-stylesheet to convert a xml-file to pdf and have a serious problem with the generate-id() - function.
Here's my XSL-Stylesheet: <xsl:template match="TT"> <fo:wrapper id="{generate-id(.)}" xsl:use-attribute-sets="tt"> <xsl:apply-templates/> </fo:wrapper> </xsl:template> I use the "id" attribute, because I want to append a list of all TT-Elements to my pdf-file. It worked for several files, but if I had tested it on an really large file (800Kb; about 140 pages) I got the following message: org.apache.fop.apps.FOPException: org.apache.fop.apps.FOPException: The id "N402100" already exists in this document at org.apache.fop.apps.CommandLineStarter.run(Unknown Source) at org.apache.fop.apps.Fop.main(Unknown Source) --------- java.lang.RuntimeException: org.apache.fop.apps.FOPException: The id "N402100" already exists in this document at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3170) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH andlerImpl.java:433) at org.apache.xerces.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.ja va:715) at org.apache.xerces.impl.XMLNamespaceBinder.endDocument(XMLNamespaceBinder.jav a:704) at org.apache.xerces.impl.dtd.XMLDTDValidator.endDocument(XMLDTDValidator.java: 985) at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerIm pl.java:437) at org.apache.xerces.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1159 ) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager. java:3204) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(XMLEntityMa nager.java:2861) at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatc h(XMLDocumentScannerImpl.java:987 ) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume ntFragmentScannerImpl.java:333) at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo nfiguration.java:529) at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo nfiguration.java:585) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147) at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:114 8) at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134) at org.apache.fop.apps.Driver.render(Unknown Source) at org.apache.fop.apps.CommandLineStarter.run(Unknown Source) at org.apache.fop.apps.Fop.main(Unknown Source) --------- java.lang.RuntimeException: org.apache.fop.apps.FOPException: The id "N402100" already exists in this document at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3170) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH andlerImpl.java:433) at org.apache.xerces.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.ja va:715) at org.apache.xerces.impl.XMLNamespaceBinder.endDocument(XMLNamespaceBinder.jav a:704) at org.apache.xerces.impl.dtd.XMLDTDValidator.endDocument(XMLDTDValidator.java: 985) at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerIm pl.java:437) at org.apache.xerces.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1159 ) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager. java:3204) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(XMLEntityMa nager.java:2861) at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatc h(XMLDocumentScannerImpl.java:987 ) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume ntFragmentScannerImpl.java:333) at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo nfiguration.java:529) at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo nfiguration.java:585) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147) at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:114 8) at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134) at org.apache.fop.apps.Driver.render(Unknown Source) at org.apache.fop.apps.CommandLineStarter.run(Unknown Source) at org.apache.fop.apps.Fop.main(Unknown Source) I had some ideas, where it could come from: 1.) not well-formed xml-file 2.) maybe I used generate-id() two times for the same element but I can exclude both. The first because I checked my document several times. The second because my stylesheet worked very well with smaller files and a lot of TT elements inside. So does anybody know, if the "generate-id()" function has ANY limitation. For everybody who is not very familiar with the fop-inside, but very familiar with java I tried to find the source for "generate-id()". I'm really not sure, but I assume it's in the following file: file:src\org\apache\xalan\xsltc\compiler\util\MethodGenerator.java public class MethodGenerator extends MethodGen implements org.apache.xalan.xsltc.compiler.Constants { ... public int getLocalIndex(String name){ return getLocalVariable(name).getIndex(); } public LocalVariableGen getLocalVariable(String name){ final LocalVariableGen[] vars = getLocalVariables(); for (int i = 0; i < vars.length; i++) if (vars[i].getName().equals(name)) return vars[i]; return null; } ... } Comments? Clemens Kutz --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]