RE: Need Working Sample

2001-07-08 Thread Michiel Verhoef

Just a thought but what you seem to want is the XML file processed by XSL
(which can be on disk).

Have you checked the docs/examples for Xalan, the XSLT processor oncluded
with FOP?
Because that is what you've been asking for: how dow I process my XML file
using my XSLT
stylesheet.

Sorry, no Java programmer so I can't give any techie tips but I'd go and
have a look at the Xalan
docs and examples if I were you..

Good luck,

Michiel


$ -Original Message-
$ From: Jim Urban [mailto:[EMAIL PROTECTED]]
$ Sent: vrijdag 6 juli 2001 17:52
$ To: [EMAIL PROTECTED]
$ Subject: RE: Need Working Sample
$ 
$ 
$ Sorry, but this does not work for two reasons.
$ 
$ 1. The XML does NOT exist on disk!  It is in memory only, and 
$ writing it to
$ disk is NOT an option.
$ 
$ 2. This is a high traffic web application.  Starting a new 
$ JVM to process
$ FOP is too costly.
$ 
$ There must be a way for this FOP thing to read raw (data only) XML (in
$ memory) apply an XSL style sheet to add the FO tags, then 
$ format the PDF and
$ return it to a browser.  I can't believe I am the first 
$ person in the word
$ to need to do this.
$ 
$ If I seem upset, I'm sorry.  But I have been fighting with 
$ FOP since last
$ week to get it to do this.  FOP works great for taking FO files and
$ converting them to PDF files, but that's not what I have to 
$ do.  I have a
$ deadline to meet and I have wasted a week trying to get FOP to work.
$ 
$ Jim
$ 
$ -Original Message-
$ From: Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]]
$ Sent: Friday, July 06, 2001 10:11 AM
$ To: '[EMAIL PROTECTED]'
$ Subject: RE: Need Working Sample
$ 
$ 
$ Hi Jim,
$ I have exactly the same problem, and I've just found a non
$ elegant, working solution:
$ 
$ I generate my XML file, and then call the command line Fop 
$ from within my
$ servlet:
$ 
$ Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
$ "c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib
$ \\w3c.jar;c:\\
$ fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-
$ DEV\\lib\\xerc
$ es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
$ "org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
$ "c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"});
$ 
$ As I said, it is NOT elegant, but after sweating for days 
$ with problems of
$ all type doing the elegant thing, I get my beautiful PDF on disk.
$ 
$ Of course you should adapt the names of trhe directories  and 
$ the xml and
$ xsl files.
$ 
$ Cheers,
$Gustavo
$ 
$ PS: if someone has an elegant solution I would be happy to use it too.
$ 
$ >  -Message d'origine-
$ > De :Jim Urban [mailto:[EMAIL PROTECTED]]
$ > Envoyé :vendredi, 6. juillet 2001 17:09
$ > À : [EMAIL PROTECTED]
$ > Objet : Need Working Sample
$ >
$ > Hi, I am new to FOP.  I have a servlet which dynamically 
$ generates XML.  I
$ > need to apply an XSL stylesheet containing FO tags to generate a FO
$ > version of the XML and then I need to run this FO version of the XML
$ > through FOP (or Driver) so the servlet can return a 
$ dynamically created
$ > PDF to the browser.  Does anyone have a working example of 
$ how to do this?
$ > Only the XSL style sheet containing the FO tags used in the initial
$ > transform will be on disk.  Please help, I have to get this working.
$ >
$ > Thanks,
$ >
$ > Jim Urban
$ > Product Manager
$ > Netsteps Inc.
$ > Suite 505E
$ > 1 Pierce Pl.
$ > Itasca, IL  60143
$ > Voice:  (630) 250-3045 x2164
$ > Fax:  (630) 250-3046
$ >
$ > << Fichier: ATT14204.txt>>
$ 
$ -
$ To unsubscribe, e-mail: [EMAIL PROTECTED]
$ For additional commands, email: [EMAIL PROTECTED]
$ 
$ 
$ 
$ -
$ To unsubscribe, e-mail: [EMAIL PROTECTED]
$ For additional commands, email: [EMAIL PROTECTED]
$ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Need Working Sample

2001-07-06 Thread Karen Lease

Hi again,

Just to make sure I wasn't talking through my hat, I tried out what I
told you to do. It works OK for me. I attached a short java file
(TestXSLT) which I tested with your xml and xsl. Here is what I used to
run it (TestXSLT.class in the local directory).

java -cp
.:build/fop.jar:lib/xerces-1.2.3.jar:lib/xalan-2.0.0.jar:lib/batik.jar
TestXSLT prueba.xml prueba.xsl

It looks like you had all the pieces, but maybe not in the right order.

If it works, I'll collect the beer next time I'm in Geneva (unless
you're in Paris (France, not Texas!) before then.

Salut,
Karen

"Wolf Gustavo (SGC-EXT)" wrote:
> 
> Hi Erik,
>  I have tried your stuff, but it still gives me the same problem i
> have since two days after I try to instantiate the parser:
> 
> javax.xml.transform.TransformerConfigurationException: Namespace not
> supported by SAXParser
> Error msg: null
> 
> At the risk of looking abusive, could someone take a look at the xml and xsl
> files (they are really short examples that work with Fop as a line command,
> and I'll invite a beer to whomever comes to Geneva (CH, not IL) to pick it
> up)?
>

import java.io.File;

import org.apache.fop.apps.InputHandler;
import org.apache.fop.apps.XSLTInputHandler;
import org.apache.fop.apps.Driver;

// SAX
import org.xml.sax.XMLReader;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public classTestXSLT {

public static void main(String args[]) {
if (args.length != 2) {
System.err.println("Usage: TestXSLT xmlfile xslfile");
System.exit(1);
}
try {
File xmlInputSource = new File(args[0]);
File xslInputSource = new File(args[1]);
InputHandler inputHandler = new
XSLTInputHandler(xmlInputSource,xslInputSource);
XMLReader parser = inputHandler.getParser();
parser.setFeature("http://xml.org/sax/features/namespace-prefixes";,
  true);
 
/**
* Creates the driver telling it to write the output to a file.
*/
Driver driver = new Driver();
driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer");
//  ERROR IN THE FOLLOWING LINE
driver.buildFOTree(parser,inputHandler.getInputSource());
File test = new File("test.pdf");
driver.setOutputStream(new java.io.FileOutputStream(test));
driver.format();
driver.render();
}
catch (Exception e) {
System.err.println("Caught exception: " + e);
e.printStackTrace();
}
}
}



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


Re: Need Working Sample

2001-07-06 Thread Dave Frankson

I've been doing XML+XSL+FOP transforms in a servlet for months.  I have
a servlet that takes an xml and an xsl parameter (either a url to a file, a
url to a jsp page that dynamically generates the xml, or an ObjectID that
where the Object is taken from an Object database and transformed to xml in
memory).  It then passes it through xalan and if necessary fop and returns
either xml, html, or a pdf.

Here is some code adapted from that servlet:


String xmlData = ""; //--- This is your xml in memory
String xslData = ""; //--- Tis is your xsl in memory

StreamSource xmlSource = new StreamSource(new StringReader(xmlData));
StreamSource xslSource = new StreamSource(new StringReader(xslData));

StringWriter transformOut = new StringWriter();

StreamResult xsltOut = new StreamResult(transformOut);

 try {
  Transformer transformer = factory.newTransformer(xslSource);
  transformer.transform(xmlSource, xsltOut);
 }catch(Exception e) {System.out.println("XSLT Exception: " + e);
e.printStackTrace();}


  ByteArrayOutputStream pdfContent = new ByteArrayOutputStream();

   InputSource fopIn = new InputSource(new
StringReader(transformOut.toString()));

   response.setContentType("application/pdf");
   response.addHeader("Content-Disposition", "inline; filename=report.pdf");
   BufferedOutputStream out = new
BufferedOutputStream(response.getOutputStream());

   try {
String parserClassName = System.getProperty("org.xml.sax.parser");
if (parserClassName == null) parserClassName =
"org.apache.xerces.parsers.SAXParser";
XMLReader parser =
(XMLReader)Class.forName(parserClassName).newInstance();

parser.setFeature("http://xml.org/sax/features/namespace-prefixes";,
true);
String version = Version.getVersion();
Driver driver = new Driver();
driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);
driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");

driver.addElementMapping("org.apache.fop.extensions.ExtensionElementMapping"
);
driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");
driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");

driver.addPropertyList("org.apache.fop.extensions.ExtensionPropertyListMappi
ng");

driver.setOutputStream(pdfContent);
driver.buildFOTree(parser, fopIn);
driver.format();
driver.render();
   }catch(Exception e) {System.out.println("FOP Exception: " + e);}

   byte[] pdfDoc = pdfContent.toByteArray();

   response.setContentLength( pdfDoc.length );
   out.write( pdfDoc);
  }
   out.flush();
   out.close();


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Need Working Sample

2001-07-06 Thread Steven Lane

>The FopServlet reads a .fo file.  This is of no use to me.  I will
>dyamically generate XML contianing only data.  This XML will be in a
>StringBuffer.  I first need to apply an XSL sytle sheet to this
>StringBuffer, generating a new XML stream (IN MEMORY).  This new (IN MEMORY)
>XML stream then needs to be ran through FOP to generate a PDF stream which
>will be sent back to the browser.  The embed sample also shows how to
>process .FO files.  This is not what I want  The ONLY file that can be
>on disk is the XSL file which contains the FO tags to apply to the XML data.

Applying XSL to your XML in memory should be fairly easy. The
transformation APIs in JAXP handle this. then just edit the servlet code to
handle something other than a file stream. I got this to work without much
problem a while ago. My code is appended below -- I think it worked with
0.17, haven't checked it in a while. It differs only slightly from the
original. The fo data comes in an HTTP parameter called "fo", though you
can change the name. It loads this all into the String called fo. Then when
it sets up the driver, instead of passing it a FileInputSource, it passes
it a StringInputSource derived from the fo String.

I dimly recollect that the Driver interface changed a lot in 0.18 so some
of these methods may now be hidden, i.e. not called directly in the
servlet, but if you manually configure your driver, changing the type of
input source you hand it should not be hard.

-- sgl

/*-- $Id: FopServlet.java,v 1.2 2001/03/03 07:06:03 kellyc Exp $ --

 
   The Apache Software License, Version 1.1
 

Copyright (C) 1999 The Apache Software Foundation. All rights reserved.

 Redistribution and use in source and binary forms, with or without modifica-
 tion, are permitted provided that the following conditions are met:

 1. Redistributions of  source code must  retain the above copyright  notice,
this list of conditions and the following disclaimer.

 2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

 3. The end-user documentation included with the redistribution, if any, must
include  the following  acknowledgment:  "This product includes  software
developed  by the  Apache Software Foundation  (http://www.apache.org/)."
Alternately, this  acknowledgment may  appear in the software itself,  if
and wherever such third-party acknowledgments normally appear.

 4. The names "Fop" and  "Apache Software Foundation"  must not be used to
endorse  or promote  products derived  from this  software without  prior
written permission. For written permission, please contact
[EMAIL PROTECTED]

 5. Products  derived from this software may not  be called "Apache", nor may
"Apache" appear  in their name,  without prior written permission  of the
Apache Software Foundation.

 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
 APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
 INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
 DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
 OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
 ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
 (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 This software  consists of voluntary contributions made  by many individuals
 on  behalf of the Apache Software  Foundation and was  originally created by
 James Tauber <[EMAIL PROTECTED]>. For more  information on the Apache
 Software Foundation, please see .

 */



// Java
import java.io.*;
import java.net.URL;
import java.util.Date;

import javax.servlet.*;
import javax.servlet.http.*;

// SAX
import org.xml.sax.XMLReader;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;


// FOP
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.apps.Driver;
import org.apache.fop.apps.Version;


/**
 * Example servlet to generate a PDF from a servlet.
 * Servlet param is:
 * 
 *   fo: the path to a formatting object file to render
 * 
 *
 * Example URL:
http://servername/servlet/FopServlet?fo=/home/fop/example/readme.fo
 *
 */

public class FopStream extends HttpServlet
{
public static final String FO_REQUEST_PARAM = 

RE: Need Working Sample

2001-07-06 Thread Wolf Gustavo (SGC-EXT)

Hi Erik,
 I have tried your stuff, but it still gives me the same problem i
have since two days after I try to instantiate the parser:

javax.xml.transform.TransformerConfigurationException: Namespace not
supported by SAXParser
Error msg: null

At the risk of looking abusive, could someone take a look at the xml and xsl
files (they are really short examples that work with Fop as a line command,
and I'll invite a beer to whomever comes to Geneva (CH, not IL) to pick it
up)?

They are attached once more.

Really thanks, and sorry to know that Jim cannot use my non-elegant
solution. I am fighting this stuff for days also and I have to finish my
project by next Friday.



-Message d'origine-
De : Erik Rehrmann [mailto:[EMAIL PROTECTED]]
Envoyé : vendredi, 6. juillet 2001 17:26
À : '[EMAIL PROTECTED]'
Objet : AW: Need Working Sample


Hi Gustavo,

the following works great:

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PDF);
  InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
  org.xml.sax.XMLReader parser = inputHandler.getParser();
  driver.buildFOTree(parser, inputHandler.getInputSource());
  driver.format();
  driver.setOutputStream(out);
  driver.render();

  response.setContentType("application/pdf");
  byte[] content = out.toByteArray();
  response.setContentLength(content.length);
  response.getOutputStream().write(content);
  response.getOutputStream().flush();

This example lets the servlet stream the result directly to the client
browser. If you want to have the pdf file on your disk instead, just write
use an other output stream!

It currently does not work for IE5.5, but I'll check the hint of Alex
McLintock earlier in this list.

Hope this helps you out,
___
Erik Rehrmann - IOn AG
[EMAIL PROTECTED]




> -Ursprüngliche Nachricht-
> Von: Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 6. Juli 2001 17:11
> An: '[EMAIL PROTECTED]'
> Betreff: RE: Need Working Sample
> 
> 
> Hi Jim,
> I have exactly the same problem, and I've just found a non
> elegant, working solution:
> 
> I generate my XML file, and then call the command line Fop 
> from within my
> servlet:
> 
> Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
> "c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib
> \\w3c.jar;c:\\
> fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-
> DEV\\lib\\xerc
> es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
> "org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
> "c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"}); 
> 
> As I said, it is NOT elegant, but after sweating for days 
> with problems of
> all type doing the elegant thing, I get my beautiful PDF on disk.
> 
> Of course you should adapt the names of trhe directories  and 
> the xml and
> xsl files.
> 
> Cheers,
>Gustavo
> 
> PS: if someone has an elegant solution I would be happy to 
> use it too. 
> 
> >  -Message d'origine-
> > De :Jim Urban [mailto:[EMAIL PROTECTED]] 
> > Envoyé :vendredi, 6. juillet 2001 17:09
> > À : [EMAIL PROTECTED]
> > Objet : Need Working Sample
> > 
> > Hi, I am new to FOP.  I have a servlet which dynamically 
> generates XML.  I
> > need to apply an XSL stylesheet containing FO tags to generate a FO
> > version of the XML and then I need to run this FO version of the XML
> > through FOP (or Driver) so the servlet can return a 
> dynamically created
> > PDF to the browser.  Does anyone have a working example of 
> how to do this?
> > Only the XSL style sheet containing the FO tags used in the initial
> > transform will be on disk.  Please help, I have to get this working.
> > 
> > Thanks,
> > 
> > Jim Urban
> > Product Manager
> > Netsteps Inc.
> > Suite 505E
> > 1 Pierce Pl.
> > Itasca, IL  60143
> > Voice:  (630) 250-3045 x2164
> > Fax:  (630) 250-3046
> > 
> > << Fichier: ATT14204.txt>> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



 prueba.xml
 prueba.xsl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


RE: Need Working Sample

2001-07-06 Thread John Wyman
Title: Message



This example uses xml from a file, but if you 
define your Stream as a StreamSource you can use this to process the XML - 
XSL to create an in mem FO and feed it to the Driver as shown. hope this 
helps.  
   
try 
{   
InputStream is 
=    
new BufferedInputStream(new 
FileInputStream(args[3]));   
StreamSource xmlSource = new StreamSource(is, 
args[3]);   xmlSource.setSystemId("d:\\xmetal2\\Rules\\");    
is = new BufferedInputStream(new 
FileInputStream(args[2]));    
StreamSource xslSource = new StreamSource(is, 
args[2]);   xslSource.setSystemId("d:\\xmetal2\\Rules\\");    
DOMResult result = new DOMResult();
 
    
TransformerFactory f = 
TransformerFactory.newInstance();    
Templates templates = 
f.newTemplates(xslSource);    
Transformer transformer = templates.newTransformer();   int 
nArgs = 0;   for (int i = 0; i < args.length; i++) 
{ int k = 
args[i].indexOf('='); if (k > 
0)   transformer.setParameter(args[i].substring(0, 
k),  args[i].substring(k + 
1)); else   args[nArgs++] = 
args[i];   }
 
    
transformer.transform(xmlSource, result);
 
    Driver 
driver = new Driver();
 
    
driver.setRenderer(Driver.RENDER_PDF);
 
    
driver.buildFOTree((Document) result.getNode());
 
    
driver.format();
 
    
driver.setOutputStream(new FileOutputStream(args[1]+".pdf"));
 
    
driver.render();  }  catch (Exception ex) { 
System.out.println(ex.toString()); 
}  System.out.println("Finished"); }
 
 
John H. Wyman5160 Darry LaneDublin, OH 
43016(614)-889-0698[EMAIL PROTECTED] Wyman 
Genealogy Site Francis Wyman Assoc 
email List http://groups.yahoo.com/group/FrancisWymanAssocWyman 
Family Genealogy Forum The 
Wyman Surname Message Board   


  
  -Original Message-From: Jim Urban 
  [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 11:09 
  AMTo: [EMAIL PROTECTED]Subject: Need Working 
  Sample
  Hi, I am new to FOP.  I have a servlet which 
  dynamically generates XML.  I need to apply an XSL stylesheet containing 
  FO tags to generate a FO version of the XML and then I need to run this FO 
  version of the XML through FOP (or Driver) so the servlet can return a 
  dynamically created PDF to the browser.  Does anyone have a working 
  example of how to do this?  Only the XSL style sheet containing the FO 
  tags used in the initial transform will be on disk.  Please help, I have 
  to get this working.
  Thanks, 
  Jim Urban Product Manager Netsteps Inc. 
  Suite 505E 1 
  Pierce Pl. Itasca, IL  60143 
  Voice:  (630) 250-3045 x2164 Fax:  (630) 250-3046 



RE: Need Working Sample

2001-07-06 Thread Jim Urban

>   InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
What is xmlFile?  Please don't tell me its a file.  My XML is NOT in a file,
its in a StringBuffer in memory, not on disk.

Jim

-Original Message-
From: Erik Rehrmann [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 10:26 AM
To: '[EMAIL PROTECTED]'
Subject: AW: Need Working Sample


Hi Gustavo,

the following works great:

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PDF);
  InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
  org.xml.sax.XMLReader parser = inputHandler.getParser();
  driver.buildFOTree(parser, inputHandler.getInputSource());
  driver.format();
  driver.setOutputStream(out);
  driver.render();

  response.setContentType("application/pdf");
  byte[] content = out.toByteArray();
  response.setContentLength(content.length);
  response.getOutputStream().write(content);
  response.getOutputStream().flush();

This example lets the servlet stream the result directly to the client
browser. If you want to have the pdf file on your disk instead, just write
use an other output stream!

It currently does not work for IE5.5, but I'll check the hint of Alex
McLintock earlier in this list.

Hope this helps you out,
___
Erik Rehrmann - IOn AG
[EMAIL PROTECTED]




> -Ursprüngliche Nachricht-
> Von: Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 6. Juli 2001 17:11
> An: '[EMAIL PROTECTED]'
> Betreff: RE: Need Working Sample
>
>
> Hi Jim,
> I have exactly the same problem, and I've just found a non
> elegant, working solution:
>
> I generate my XML file, and then call the command line Fop
> from within my
> servlet:
>
> Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
> "c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib
> \\w3c.jar;c:\\
> fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-
> DEV\\lib\\xerc
> es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
> "org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
> "c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"});
>
> As I said, it is NOT elegant, but after sweating for days
> with problems of
> all type doing the elegant thing, I get my beautiful PDF on disk.
>
> Of course you should adapt the names of trhe directories  and
> the xml and
> xsl files.
>
> Cheers,
>Gustavo
>
> PS: if someone has an elegant solution I would be happy to
> use it too.
>
> >  -Message d'origine-
> > De :Jim Urban [mailto:[EMAIL PROTECTED]]
> > Envoyé :vendredi, 6. juillet 2001 17:09
> > À : [EMAIL PROTECTED]
> > Objet : Need Working Sample
> >
> > Hi, I am new to FOP.  I have a servlet which dynamically
> generates XML.  I
> > need to apply an XSL stylesheet containing FO tags to generate a FO
> > version of the XML and then I need to run this FO version of the XML
> > through FOP (or Driver) so the servlet can return a
> dynamically created
> > PDF to the browser.  Does anyone have a working example of
> how to do this?
> > Only the XSL style sheet containing the FO tags used in the initial
> > transform will be on disk.  Please help, I have to get this working.
> >
> > Thanks,
> >
> > Jim Urban
> > Product Manager
> > Netsteps Inc.
> > Suite 505E
> > 1 Pierce Pl.
> > Itasca, IL  60143
> > Voice:  (630) 250-3045 x2164
> > Fax:  (630) 250-3046
> >
> > << Fichier: ATT14204.txt>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Need Working Sample

2001-07-06 Thread Marc Lindsay

You are not alone Jim,

I have exactly the same need than you (but I also want the XSL in a string
buffer).  I'm waiting impatiently the answer of your question.
Unfortunetly, I don't have any hint to provide.

Marc

-Original Message-
From: Jim Urban [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 11:52 AM
To: [EMAIL PROTECTED]
Subject: RE: Need Working Sample


Sorry, but this does not work for two reasons.

1. The XML does NOT exist on disk!  It is in memory only, and writing it to
disk is NOT an option.

2. This is a high traffic web application.  Starting a new JVM to process
FOP is too costly.

There must be a way for this FOP thing to read raw (data only) XML (in
memory) apply an XSL style sheet to add the FO tags, then format the PDF and
return it to a browser.  I can't believe I am the first person in the word
to need to do this.

If I seem upset, I'm sorry.  But I have been fighting with FOP since last
week to get it to do this.  FOP works great for taking FO files and
converting them to PDF files, but that's not what I have to do.  I have a
deadline to meet and I have wasted a week trying to get FOP to work.

Jim

-Original Message-
From: Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 10:11 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Need Working Sample


Hi Jim,
I have exactly the same problem, and I've just found a non
elegant, working solution:

I generate my XML file, and then call the command line Fop from within my
servlet:

Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
"c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\w3c.jar;c:\\
fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\xerc
es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
"org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
"c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"});

As I said, it is NOT elegant, but after sweating for days with problems of
all type doing the elegant thing, I get my beautiful PDF on disk.

Of course you should adapt the names of trhe directories  and the xml and
xsl files.

Cheers,
   Gustavo

PS: if someone has an elegant solution I would be happy to use it too.

>  -Message d'origine-
> De :  Jim Urban [mailto:[EMAIL PROTECTED]]
> Envoyé :  vendredi, 6. juillet 2001 17:09
> À :   [EMAIL PROTECTED]
> Objet :   Need Working Sample
>
> Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
> need to apply an XSL stylesheet containing FO tags to generate a FO
> version of the XML and then I need to run this FO version of the XML
> through FOP (or Driver) so the servlet can return a dynamically created
> PDF to the browser.  Does anyone have a working example of how to do this?
> Only the XSL style sheet containing the FO tags used in the initial
> transform will be on disk.  Please help, I have to get this working.
>
> Thanks,
>
> Jim Urban
> Product Manager
> Netsteps Inc.
> Suite 505E
> 1 Pierce Pl.
> Itasca, IL  60143
> Voice:  (630) 250-3045 x2164
> Fax:  (630) 250-3046
>
> << Fichier: ATT14204.txt>>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Need Working Sample

2001-07-06 Thread Jim Urban

Sorry, but this does not work for two reasons.

1. The XML does NOT exist on disk!  It is in memory only, and writing it to
disk is NOT an option.

2. This is a high traffic web application.  Starting a new JVM to process
FOP is too costly.

There must be a way for this FOP thing to read raw (data only) XML (in
memory) apply an XSL style sheet to add the FO tags, then format the PDF and
return it to a browser.  I can't believe I am the first person in the word
to need to do this.

If I seem upset, I'm sorry.  But I have been fighting with FOP since last
week to get it to do this.  FOP works great for taking FO files and
converting them to PDF files, but that's not what I have to do.  I have a
deadline to meet and I have wasted a week trying to get FOP to work.

Jim

-Original Message-
From: Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 10:11 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Need Working Sample


Hi Jim,
I have exactly the same problem, and I've just found a non
elegant, working solution:

I generate my XML file, and then call the command line Fop from within my
servlet:

Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
"c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\w3c.jar;c:\\
fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\xerc
es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
"org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
"c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"});

As I said, it is NOT elegant, but after sweating for days with problems of
all type doing the elegant thing, I get my beautiful PDF on disk.

Of course you should adapt the names of trhe directories  and the xml and
xsl files.

Cheers,
   Gustavo

PS: if someone has an elegant solution I would be happy to use it too.

>  -Message d'origine-
> De :  Jim Urban [mailto:[EMAIL PROTECTED]]
> Envoyé :  vendredi, 6. juillet 2001 17:09
> À :   [EMAIL PROTECTED]
> Objet :   Need Working Sample
>
> Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
> need to apply an XSL stylesheet containing FO tags to generate a FO
> version of the XML and then I need to run this FO version of the XML
> through FOP (or Driver) so the servlet can return a dynamically created
> PDF to the browser.  Does anyone have a working example of how to do this?
> Only the XSL style sheet containing the FO tags used in the initial
> transform will be on disk.  Please help, I have to get this working.
>
> Thanks,
>
> Jim Urban
> Product Manager
> Netsteps Inc.
> Suite 505E
> 1 Pierce Pl.
> Itasca, IL  60143
> Voice:  (630) 250-3045 x2164
> Fax:  (630) 250-3046
>
> << Fichier: ATT14204.txt>>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Need Working Sample

2001-07-06 Thread Ralph LaChance

At 10:08 AM 7/6/01 -0500, you wrote:
Hi, I am new to
FOP.
I urge you to check the references on the fop web site -- 
particularly Ch15 of Harold. XML Bible
and the two Eisenburg tutorials 
http://www.xml.com/pub/a/2001/01/17/xsl-fo/index.html




'
Best,
-Ralph
LaChance




RE: Need Working Sample

2001-07-06 Thread Jim Urban

The FopServlet reads a .fo file.  This is of no use to me.  I will
dyamically generate XML contianing only data.  This XML will be in a
StringBuffer.  I first need to apply an XSL sytle sheet to this
StringBuffer, generating a new XML stream (IN MEMORY).  This new (IN MEMORY)
XML stream then needs to be ran through FOP to generate a PDF stream which
will be sent back to the browser.  The embed sample also shows how to
process .FO files.  This is not what I want  The ONLY file that can be
on disk is the XSL file which contains the FO tags to apply to the XML data.

Jim

-Original Message-
From: Cyril Rognon [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 10:03 AM
To: [EMAIL PROTECTED]
Subject: Re: Need Working Sample


There is a FOP servlet example in the distribution of FOP :

/docs/examples/embedding/FopServlet.java

I think it will answer all the beginners questions.
See the example section on the FOP site to see all pre-answered question
you might have in your beginning journey.
(starting with http://xml.apache.org/fop/embedding.html)

Cyril

At 10:08 06/07/01 -0500, you wrote:
>Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
>need to apply an XSL stylesheet containing FO tags to generate a FO version
>of the XML and then I need to run this FO version of the XML through FOP
(or
>Driver) so the servlet can return a dynamically created PDF to the browser.
>Does anyone have a working example of how to do this?  Only the XSL style
>sheet containing the FO tags used in the initial transform will be on disk.
>Please help, I have to get this working.
>
>Thanks,


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Need Working Sample

2001-07-06 Thread Wolf Gustavo (SGC-EXT)

The problem with that example is that it assumes that you already have the
.fo file, the production of which I've found to be the difficult part.

Gustavo

-Message d'origine-
De : Cyril Rognon [mailto:[EMAIL PROTECTED]]
Envoye : vendredi, 6. juillet 2001 17:03
A : [EMAIL PROTECTED]
Objet : Re: Need Working Sample


There is a FOP servlet example in the distribution of FOP :

/docs/examples/embedding/FopServlet.java

I think it will answer all the beginners questions.
See the example section on the FOP site to see all pre-answered question 
you might have in your beginning journey.
(starting with http://xml.apache.org/fop/embedding.html)

Cyril

At 10:08 06/07/01 -0500, you wrote:
>Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
>need to apply an XSL stylesheet containing FO tags to generate a FO version
>of the XML and then I need to run this FO version of the XML through FOP
(or
>Driver) so the servlet can return a dynamically created PDF to the browser.
>Does anyone have a working example of how to do this?  Only the XSL style
>sheet containing the FO tags used in the initial transform will be on disk.
>Please help, I have to get this working.
>
>Thanks,


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Need Working Sample

2001-07-06 Thread Wolf Gustavo (SGC-EXT)

Hi Jim,
I have exactly the same problem, and I've just found a non
elegant, working solution:

I generate my XML file, and then call the command line Fop from within my
servlet:

Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
"c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\w3c.jar;c:\\
fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\xerc
es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
"org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
"c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"}); 

As I said, it is NOT elegant, but after sweating for days with problems of
all type doing the elegant thing, I get my beautiful PDF on disk.

Of course you should adapt the names of trhe directories  and the xml and
xsl files.

Cheers,
   Gustavo

PS: if someone has an elegant solution I would be happy to use it too. 

>  -Message d'origine-
> De :  Jim Urban [mailto:[EMAIL PROTECTED]] 
> Envoyé :  vendredi, 6. juillet 2001 17:09
> À :   [EMAIL PROTECTED]
> Objet :   Need Working Sample
> 
> Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
> need to apply an XSL stylesheet containing FO tags to generate a FO
> version of the XML and then I need to run this FO version of the XML
> through FOP (or Driver) so the servlet can return a dynamically created
> PDF to the browser.  Does anyone have a working example of how to do this?
> Only the XSL style sheet containing the FO tags used in the initial
> transform will be on disk.  Please help, I have to get this working.
> 
> Thanks,
> 
> Jim Urban
> Product Manager
> Netsteps Inc.
> Suite 505E
> 1 Pierce Pl.
> Itasca, IL  60143
> Voice:  (630) 250-3045 x2164
> Fax:  (630) 250-3046
> 
> << Fichier: ATT14204.txt>> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Need Working Sample

2001-07-06 Thread Cyril Rognon

There is a FOP servlet example in the distribution of FOP :

/docs/examples/embedding/FopServlet.java

I think it will answer all the beginners questions.
See the example section on the FOP site to see all pre-answered question 
you might have in your beginning journey.
(starting with http://xml.apache.org/fop/embedding.html)

Cyril

At 10:08 06/07/01 -0500, you wrote:
>Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
>need to apply an XSL stylesheet containing FO tags to generate a FO version
>of the XML and then I need to run this FO version of the XML through FOP (or
>Driver) so the servlet can return a dynamically created PDF to the browser.
>Does anyone have a working example of how to do this?  Only the XSL style
>sheet containing the FO tags used in the initial transform will be on disk.
>Please help, I have to get this working.
>
>Thanks,


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]