You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alan Anderson <al...@rushmore.com> on 2003/02/20 08:49:05 UTC

Generators and external applications...

Hello,

I have successfully configured and used Cocoon 2.0.3 on Linux to generate HTML and PDF files on the
fly from XML source files.  I've used primarily DocBook source, but I have a few other types of
source files.

Part of what I want to do is generate complex documents from multiple source locations.  The DocBook
source files contain tags which are used by external programs (in this case RefDB) to generate
information for the final document.  While part of this process is the application of stylesheets,
part of it is the execution of a separate client program which retrieves the information from a
database.

My question is how can I run an external program/script and have the final output be what is sent to
the Transformer for display?  I'm guessing I'm missing something really obvious because no one else
seems to ask this question.  My initial observation was that I would need to write a Generator to do
the work I need done by the RefDB client application.  My second observation was I might be able to
use Jython or JavaScript to execute the program for me using the ScriptGenerator.

For the case of JavaScript, I think I'm limited in its ability to access the server OS.  Jython
should be able to do the trick, but it seems a little kludgy to write a script which simply calls an
executable on the OS and forwards the XML output.

Is there an easy way to do this?  Am I destined to write a Generator?  I looked at XSP, but my
initial observation was that it probably wouldn't work, but I might have missed something here also.

Thanks,

Al


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


RE: Generators and external applications...

Posted by Conal Tuohy <co...@paradise.net.nz>.
Alan Anderson wrote:

> My question is how can I run an external program/script and
> have the final output be what is sent to
> the Transformer for display?  I'm guessing I'm missing

One option is to run your external executable as a CGI app. This may be
easier than porting it to a Generator. Then you can use the FileGenerator to
read from the CGI application, of course.

Con


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org