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 Pedro Barco Bernal <pb...@ceh.junta-andalucia.es> on 2002/02/06 11:51:50 UTC

SimpleTranform xsl, xml to fo using Xalan

Hi all,

    These sentences works perfectly at local machine (make the fo file) but
when we run it at server write a fofile empty, and there aren't any error or
exception...

    ¿Someone knows what could be the problem?

//Make transformation of xmlfile to fo-file using  xslfile

 TransformerFactory tFactory = TransformerFactory.newInstance();
 Transformer transformer = tFactory.newTransformer(new
StreamSource("xsl.xsl"));
 transformer.transform(new StreamSource("xml.xml"), new StreamResult(new
FileOutputStream("xml.fo")));



Re: SimpleTranform xsl, xml to fo using Xalan

Posted by Pedro Barco Bernal <pb...@ceh.junta-andalucia.es>.
I tried with this, but I didn't obtain any result... ¿What is the problem?


//Make transformation of xmlfile to fo-file using  xslfile

 TransformerFactory tFactory = TransformerFactory.newInstance();
 Transformer transformer = tFactory.newTransformer(new
StreamSource("xsl.xsl"));
  FileOutputStream f = new FileOutputStream("xml2.fo");
  StreamResult h = new StreamResult(f);
 transformer.transform(new StreamSource("xml.xml"), h);
  f.flush();
  f.close();

----- Original Message -----
From: "Keiron Liddle" <ke...@aftexsw.com>
To: <fo...@xml.apache.org>
Sent: Wednesday, February 06, 2002 12:01 PM
Subject: Re: SimpleTranform xsl, xml to fo using Xalan


> On 2002.02.06 11:51 Pedro Barco Bernal wrote:
> > Hi all,
> >
> >     These sentences works perfectly at local machine (make the fo file)
> > but
> > when we run it at server write a fofile empty, and there aren't any
error
> > or
> > exception...
> >
> >     ¿Someone knows what could be the problem?
> >
> > //Make transformation of xmlfile to fo-file using  xslfile
> >
> >  TransformerFactory tFactory = TransformerFactory.newInstance();
> >  Transformer transformer = tFactory.newTransformer(new
> > StreamSource("xsl.xsl"));
> >  transformer.transform(new StreamSource("xml.xml"), new StreamResult(new
> > FileOutputStream("xml.fo")));
>
> This simply writes to the streams. You should do a bit more handling such
> as flushing and closing the streams I think. You are probably exiting or
> reading the file before it is written out.


Re: SimpleTranform xsl, xml to fo using Xalan

Posted by Keiron Liddle <ke...@aftexsw.com>.
On 2002.02.06 11:51 Pedro Barco Bernal wrote:
> Hi all,
> 
>     These sentences works perfectly at local machine (make the fo file)
> but
> when we run it at server write a fofile empty, and there aren't any error
> or
> exception...
> 
>     ¿Someone knows what could be the problem?
> 
> //Make transformation of xmlfile to fo-file using  xslfile
> 
>  TransformerFactory tFactory = TransformerFactory.newInstance();
>  Transformer transformer = tFactory.newTransformer(new
> StreamSource("xsl.xsl"));
>  transformer.transform(new StreamSource("xml.xml"), new StreamResult(new
> FileOutputStream("xml.fo")));

This simply writes to the streams. You should do a bit more handling such 
as flushing and closing the streams I think. You are probably exiting or 
reading the file before it is written out.