使用 Saxon 指定输出文件扩展名 [英] Specify output file extension with Saxon

查看:59
本文介绍了使用 Saxon 指定输出文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 Saxon 指定输出文件扩展名?

Is it possible to specify output file extension with Saxon?

处理多个输入文件时,o:"选项指定顶级目标目录.所有生成的文件都有一个.xml"扩展名.可以使用脚本来更改这些内容,但如果有一种方法可以指定所需的扩展名、命令行或从 XSL 文件中指定,那就容易多了.

When processing multiple input files, the "o:" option specifies the top level target directory. All the generated files have an ".xml" extension. It would be possible to change these with a script, but it would be significantly easier if there was a way to specify the desired extension, command line or from within the XSL file.

推荐答案

可以通过设置<xsl:output media-type="text/html"/>text/plain 在样式表中,但除此之外没有更改扩展名的机制.如果您想要更大的灵活性,请使用 Saxon 的 Java API 而不是命令行.

You can get the extension .html or .txt by setting <xsl:output media-type="text/html"/> or text/plain in the stylesheet, but apart from that there's no mechanism for changing the extension. If you want more flexibility, use Saxon's Java API rather than the command line.

这篇关于使用 Saxon 指定输出文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆