You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Elmström Johan <Jo...@edb.com> on 2005/12/02 11:52:20 UTC

xsltc trax transformer problems

Hi All

 

I'm getting a really confusing error when trying to generate a standard PDF file.

 

When I'm using the exact same XML and XSL:FO with two different transformers I get what I want with one (standard xalan transformer) but with the other (xalan xsltc.trax transformer) FOP just hangs and kills the appserver (BEA Weblogic 8.1.4 SP4) .

 

I've tried setting the logging to the finest I can ( ConsoleLogger log = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG);  ) , but once 'Setting Up Fonts' is displayed FOP breaks down

 

### Log message ###

 

[INFO] building formatting object tree

[WARNING] Screen logger not set - Using ConsoleLogger.

[INFO] setting up fonts

 

### END LOG ###

- At this point I have to kill the server by stopping the process. (sounds like an endless loop to me)

 

I have got an in-memory XML dom4j document (the trax parser could not parse my w3c document, because the value of a TextNode was null, and threw a NullPointerException @ DOM2SAX.java:308 in xalan ver 2.7.0 !?!?) and an xsl packaged in my .war file.

 

Has anyone encountered this problem when using the xalan trax.xsltc.TransformerImpl????

 

 

However I found the TraxInputHandler, and figured that might help, however, that only prints my static content. (As in all my xsl:value-of .. statements are ignored completely). 

I read in the documentation that it takes xml and xsl input (it says nothing about xsl:fo  :  "XSLTInputHandler basically takes an xml source and transforms it with an xslt source")

This is how I set it up..

InputSource xslSrc = new InputSource(xslStreamSource.getInputStream()); // from xsl:fo                                                   

                             InputSource xmlSrc = new InputSource(new DocumentSource(xmlDoc).getInputSource().getByteStream()); // From dom4j Document object

                             TraxInputHandler handler =  new TraxInputHandler(xmlSrc, xslSrc);

                             handler.run(driver); 

 

 

Am I doing it wrong?? 

Has anyone got an example of how to use the TraxInputhandler? (I can't find any useful examples by googling it, probably the first time ever that's happened)

 

Appreciate any help..

 

Regards

 

/Johan