XML 使用 xsltproc 后记
XML to postscript using xsltproc
我正在尝试为 XML 文档生成 postscript 文件。我可以使用 xsltproc.
生成纯文本或 html 输出
xsltproc --output output.txt xslFile.xsl input.xml
有没有办法从命令行或以编程方式使用 C 生成 postscript 文件?
实现此目的的一种可能性是将 XML-file 转换为 XSL-FO
,然后使用 Apache-FOP 将其转换为具有
的 Postscript-file
fop -xml input.xml -xsl xml2fo.xsl -ps output.ps
目前我无法在网上找到用于此任务的简单 XSL-file,但这取决于您希望输出的外观。为此转换创建基本的 XSLT 应该不难。
编辑:为了完整性:可能 Apache-FOP
的 output-formats 是
-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)
我正在尝试为 XML 文档生成 postscript 文件。我可以使用 xsltproc.
生成纯文本或 html 输出xsltproc --output output.txt xslFile.xsl input.xml
有没有办法从命令行或以编程方式使用 C 生成 postscript 文件?
实现此目的的一种可能性是将 XML-file 转换为 XSL-FO
,然后使用 Apache-FOP 将其转换为具有
fop -xml input.xml -xsl xml2fo.xsl -ps output.ps
目前我无法在网上找到用于此任务的简单 XSL-file,但这取决于您希望输出的外观。为此转换创建基本的 XSLT 应该不难。
编辑:为了完整性:可能 Apache-FOP
的 output-formats 是
-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)