Re: Using String for XML source

2002-12-21 Thread Oleg Tkachenko
Joannes Capitanio wrote:
I'd like to generate xml string from a different source ( using directly 
some class instead of reading from a file and creating a String 
variable )...  my xml source doen't inclusde any reference to external 
source... so
Joannes, please turn off html mode in your Outlook when you are posting 
to apache mail lists. See Apache mail lists guidelines[1].

[1] http://jakarta.apache.org/site/mail.html
--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Using String for XML source

2002-12-20 Thread Francis, Ronald



This works for 
me..
    

StringReader reader = 
new 
StringReader(strFoDocument);    
Driver driver = new Driver(new InputSource(reader), 
null);    
driver.setErrorDump(true);    
renderer = new 
PrintRenderer();    
driver.setRenderer(renderer);    
driver.run();
 
Cheers,
Ronald

  -Original Message-From: Joannes Capitanio 
  [mailto:[EMAIL PROTECTED]Sent: Friday, December 20, 2002 
  7:34 AMTo: [EMAIL PROTECTED] Apache. OrgSubject: Using 
  String for XML source
   
  I'd like to generate xml string from a different 
  source ( using directly some class instead of reading from a file 
  and creating a String variable )...  my xml source doen't 
  inclusde any reference to external source... so
  I tryed to open result using a StringReader... 
  but a lot of exception come up when I compiled my class.. 
   perhaps, systemID is always required...
   
  Could someone help me?
   
  thanks in 
advance


Re: Using String for XML source

2002-12-20 Thread Fabrizio Tringali



For me this work on 0.20.5rc
 
 
    File 
xslt = new File ("some.xsl");    File 
pdf = new File("some.pdf");    String 
xml = createXML();
    
//Construct driver    
org.apache.fop.apps.Driver driver = new 
org.apache.fop.apps.Driver();    
//Setup logger    Logger logger = new 
ConsoleLogger(ConsoleLogger.LEVEL_DEBUG);    
driver.setLogger(logger);    
MessageHandler.setScreenLogger(logger);    
//Setup Renderer (output format)    
driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);    
//Setup output    OutputStream out = 
new java.io.FileOutputStream(pdf);    
driver.setOutputStream(out);    
//Setup XSLT    TransformerFactory 
factory = 
TransformerFactory.newInstance();    
Transformer transformer = factory.newTransformer(new 
StreamSource(xslt));    //Setup input 
for XSLT transformation    Source src 
= "" StreamSource(new 
java.io.StringReader(xml));    
//Resulting SAX events (the generated FO) must be piped through to 
FOP    Result res = new 
SAXResult(driver.getContentHandler());    
//Start XSLT transformation and FOP 
processing    
transformer.transform(src, res);    
out.close();
 
hope this help
 
 

  I'd like to generate xml string from a different 
  source ( using directly some class instead of reading from a file 
  and creating a String variable )...  my xml source doen't 
  inclusde any reference to external source... so
  I tryed to open result using a StringReader... 
  but a lot of exception come up when I compiled my class.. 
   perhaps, systemID is always required...
   
  Could someone help me?
   
  thanks in 
advance


Using String for XML source

2002-12-20 Thread Joannes Capitanio



 
I'd like to generate xml string from a different 
source ( using directly some class instead of reading from a file 
and creating a String variable )...  my xml source doen't 
inclusde any reference to external source... so
I tryed to open result using a StringReader... but 
a lot of exception come up when I compiled my class.. 
 perhaps, systemID is always required...
 
Could someone help me?
 
thanks in advance