Hi Keiron!
That fixed that problem, thanks!!
Christian
-----Ursprüngliche Nachricht-----
Von: Keiron Liddle [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 20. September 2001 09:00
An: [EMAIL PROTECTED]
Betreff: Re: Does render(dom) actually work?
Hi,
This may be a problem that I have fixed.
The line number (167) doesn't seem to match anything I can find so I'm not
sure.
There was a problem where text outside the root element would cause a null
pointer exception.
Actually after a second look I think it was due to the stream redner
changes.
Could you try the current cvs and see if that helps.
Thanks
Keiron
On Thu, 20 Sep 2001 08:46:08 "Beer, Christian" wrote:
> Hi Savino, hi Suhail, hi group!
>
> In the moment I transform my source-xml to a ByteArrayOutputStream and
> then
> use a ByteArrayInputStream as input for FOP.
>
> I tried to do it the same way as Suhails example, but I get the same
> error
> Savino got.
>
> How can I be sure there are no nulls in the source??
>
> Christian
>
> -----Ursprüngliche Nachricht-----
> Von: Suhail Rashid [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 20. September 2001 06:29
> An: [EMAIL PROTECTED]
> Betreff: RE: Does render(dom) actually work?
>
>
> Hi Savino,
>
> Make sure there
> are NO nulls making their way
> into the text nodes of your xml stream.
> <these would not give problems if u
> wrote the xml to a file first>
>
> suhail
>
> -----Original Message-----
> From: Savino, Matt C [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 20, 2001 3:59 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Does render(dom) actually work?
>
>
> Yuri, thanks for your help. I tried your solution and I still get the
> following error:
>
> building formatting object tree
> building formatting object tree
> javax.xml.transform.TransformerException
> at
> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerIm
> pl.j
> ava:1212)
> at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
> ava:
> 479)
> at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
> ava:
> 1118)
> at FOtoPDF.applyFop(FOtoPDF.java:127)
> at FOtoPDF.main(FOtoPDF.java:40)
> ---------
> java.lang.NullPointerException
> at
> org.apache.fop.fo.FOTreeBuilder.startDocument(FOTreeBuilder.java:167)
> at
> org.apache.xalan.transformer.QueuedStartDocument.flush(QueuedStartDocume
> nt.j
> ava:108)
> at
> org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHa
> ndle
> r.java:758)
> at
> org.apache.xalan.transformer.ResultTreeHandler.startElement(ResultTreeHa
> ndle
> r.java:245)
> at
> org.apache.xalan.transformer.ResultTreeHandler.startElement(ResultTreeHa
> ndle
> r.java:209)
> at
> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
> ava:
> 704)
> at
> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
> form
> erImpl.java:2154)
> at
> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
> form
> erImpl.java:2097)
> at
> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transfo
> rmer
> Impl.java:2029)
> at
> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerIm
> pl.j
> ava:1189)
> at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
> ava:
> 479)
> at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
> ava:
> 1118)
> at FOtoPDF.applyFop(FOtoPDF.java:127)
> at FOtoPDF.main(FOtoPDF.java:40)
>
> It looks very similar to the one before to me. Has anyone tried this
> with
> v.0.20.1 yet? Should it say "building formatting object tree" twice? I'm
> wondering if this is some kind of issue with namespaces and the DOM2
> implementation. Anyone have any ideas?
>
> By the way, if I use a DOMResult instead of a SAXResult I get no error.
> I
> then serialized the DOMResult to a file and FO works fine with that file
> as
> an input.
>
> Thanks,
> Matt
>
>
> > -----Original Message-----
> > From: Shkuro, Yuri [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 19, 2001 2:03 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: Does render(dom) actually work?
> >
> >
> > Matt,
> >
> > Why don't you do it all in one pass? I have a servlet, that calls
> > some bean to get XML document in a DOM format (actually JDOM), then
> > registers fop driver as receiver of SAX events and runs XSLT on the
> > JDOM tree.
> >
> > // 1. Generate XML tree
> > Document xmlSummary = DataLoader.getSummary();
> >
> > // 2. Get stylesheet transformer
> > Transformer transformer =
> > transformerFactory.getTransformer(
> > <xsl-file> );
> >
> > // 3. Create FOP driver and set rendering mode
> > and output stream
> > org.apache.fop.apps.Driver driver = new
> > org.apache.fop.apps.Driver();
> > driver.setRenderer(driver.RENDER_PDF);
> > driver.setOutputStream( out );
> >
> > // 4. Create SAXResult based on FOP Driver
> > content handler which
> > will accept
> > // SAX events and build FOP tree
> > javax.xml.transform.sax.SAXResult saxResult =
> > new javax.xml.transform.sax.SAXResult(
> > driver.getContentHandler() );
> >
> > // 5. Use the Transformer to transform an XML
> > Source and send
> > the output
> > // to a Result object.
> > // Implicitely it will create the FOP tree by
> > firing SAX events
> > transformer.transform( new
> > org.jdom.transform.JDOMSource( xml ),
> > saxResult );
> >
> > YS
> >
> > -----Original Message-----
> > From: Savino, Matt C [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 19, 2001 4:33 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: Does render(dom) actually work?
> >
> >
> > Hello everyone. By any chance can someone point me to some
> > example code
> > which uses render(dom)? No matter what combination of driver
> > methods or Fop
> > versions (.17,.19,.20.1) I use I seem to get the same error:
> >
> > building formatting object tree
> > setting up fonts
> > java.lang.NullPointerException
> > at java.util.Hashtable.get(Hashtable.java:320)
> > at
> > org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:191)
> > at
> > org.apache.fop.tools.DocumentReader.parse(DocumentReader.java:444)
> > at org.apache.fop.apps.Driver.render(Driver.java:449)
> > at FOtoPDF.applyFop(FOtoPDF.java:83)
> > at FOtoPDF.main(FOtoPDF.java:24)
> >
> > Here is the source I'm using under v.0.20.1:
> > org.apache.fop.apps.Driver driver = new
> > org.apache.fop.apps.Driver();
> > driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);
> > driver.setOutputStream(new FileOutputStream(pdfFilename));
> > driver.setupDefaultMappings() ;
> >
> > driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
> >
> > driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
> >
> > driver.addElementMapping("org.apache.fop.extensions.ExtensionE
> > lementMapping"
> > );
> > driver.render(dom);
> >
> > I have tried it with and without any of the mapping methods.
> >
> > I am building the Dom object from a file. The sax input
> > handler created from
> > the same file works fine in render(parser, inputSource). I
> > have read through
> > the dev archives and found a few suggestions but none helped.
> > Is there some
> > configuration I'm missing? Or did this "break a long time
> > ago" as someone
> > suggested in the archives?
> >
> > I am hoping to use FOP in a major production app, but if I
> > can't solve this
> > I may not be able to. I am currently receiving a DOM object
> > (a small report)
> > from some database access classes. I then perform an XSLT
> > transform which
> > outputs my FO input as another DOM object. I suppose I could
> > pipe the output
> > of that to SAX? I'd really rather not have to do anything klugy like
> > serialize it to a stream and then feed it in as SAX. But I'll consider
> > anything that doesn't cause too much of a performace hit. We
> > definitely
> > don't want to have temp files sitting around, for a host of reasons.
> >
> > Thank you very much for your help.
> >
> > Matt Savino
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]