0

I am working on a project, part of it is to produce a PDF file using Apache FOP, and also produce a plain text output based on the same data as the PDF. Currently I store the data in XMLDOM, which I pass to Apache FOP to produce the PDF, I am looking to also use Apache FOP to produce a Plain Text file using the same XMLDOM input. However, I am not one to work with Apache FOP and cannot find example .xslt to produce a Plain Text file. Does anyone has an example of input .XML data and .xslt to process against said file to produce some kind of Plain Text file?

It's not logic I believe I need here, but XML->xslt->Plain Text output help with.

1 Answers1

0

Apache FOP seems to be able to produce plain text output look at the TXT section here : http://xmlgraphics.apache.org/fop/0.95/output.html

Another "simple" solution is to use PDFBox to parse the generated PDF into txt.

But if you want to go the hard way and generate text with xsl:output method="text" (never tried). Here are some pointers : https://community.oracle.com/thread/94556?start=0&tstart=0 and http://www.w3schools.com/xsl/el_output.asp

nomoa
  • 1,043
  • 6
  • 18