繁体   English   中英

使用xsltproc将XML转换为脚本

[英]XML to postscript using xsltproc

我正在尝试为XML文档生成一个后记文件。 我可以使用xsltproc生成纯文本或html输出。

xsltproc --output output.txt xslFile.xsl input.xml

有没有办法从命令行或以编程方式使用C生成后记文件?

实现此目的的一种可能性是将XML文件转换为XSL-FO ,然后使用Apache-FOP通过以下方式将其转换为Postscript文件:

fop -xml input.xml -xsl xml2fo.xsl -ps output.ps

目前,我在网上找不到用于此任务的简单XSL文件,但这取决于您希望输出看起来如何。 为此转换创建基本的XSLT并不难。

编辑:只是为了完整性:可能是Apache-FOP输出格式是

-pdf outfile      input will be rendered as PDF (outfile req'd)
-pdfa1b outfile   input will be rendered as PDF/A-1b compliant PDF
                    (outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
-awt              input will be displayed on screen 
-rtf outfile      input will be rendered as RTF (outfile req'd)
-pcl outfile      input will be rendered as PCL (outfile req'd) 
-ps outfile       input will be rendered as PostScript (outfile req'd) 
-afp outfile      input will be rendered as AFP (outfile req'd)
-tiff outfile     input will be rendered as TIFF (outfile req'd)
-png outfile      input will be rendered as PNG (outfile req'd)
-txt outfile      input will be rendered as plain text (outfile req'd) 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM