windows 是否有任何 XSLT 处理命令行工具?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6527112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Are there any XSLT processing command line tools?
提问by sjuu
I want to change an XML file to a modified XML file via an XSLT file and XSLT processing tool.
我想通过 XSLT 文件和 XSLT 处理工具将 XML 文件更改为修改后的 XML 文件。
For example: xsltprocess.exe -src a.xml -dest b.xml -xslt c.xslt
例如: xsltprocess.exe -src a.xml -dest b.xml -xslt c.xslt
Can anyone assist me?
任何人都可以帮助我吗?
采纳答案by Mathias Schwarz
If you are looking for an XSLT processor you can use Saxon: http://saxon.sourceforge.net/
如果您正在寻找 XSLT 处理器,您可以使用 Saxon:http: //saxon.sourceforge.net/
You can see the command line options here: http://saxon.sourceforge.net/saxon6.5.1/using-xsl.html
您可以在此处查看命令行选项:http: //saxon.sourceforge.net/saxon6.5.1/using-xsl.html
回答by studgeek
Microsoft has a simple command line tool that wraps their XML Parser - http://www.microsoft.com/en-us/download/details.aspx?id=21714.
微软有一个简单的命令行工具来包装他们的 XML Parser - http://www.microsoft.com/en-us/download/details.aspx?id=21714。
As @Mathias said though, it only supports XSL 1.0 while Saxon supports XSL 2.0.
正如@Mathias 所说,它只支持 XSL 1.0,而 Saxon 支持 XSL 2.0。
To run the convertor you downloaded from the given URL run this command
要运行从给定 URL 下载的转换器,请运行此命令
msxsl.exe backEnd.xml inspectcode.xslt -o backEnd.html
msxsl.exe backEnd.xml inspectcode.xslt -o backEnd.html
This will tranform the xml
file using the xslt
file into the output file in html
format
这会将xml
使用xslt
文件的文件转换为html
格式的输出文件
回答by Grzegorz Szpetkowski
You can use AltovaXMLXSLT 1.0/2.0 engine (also well-formedness and validity checking). There is free of charge community edition with direct (I mean without Java) command line interface e.g.:
您可以使用AltovaXMLXSLT 1.0/2.0 引擎(还有格式良好和有效性检查)。有直接(我的意思是没有 Java)命令行界面的免费社区版,例如:
AltovaXML.exe -xslt2 stylesheet.xsl -in input.xml -out output.xml
Check AltovaXML.chm
help file for usage.
检查AltovaXML.chm
帮助文件以了解用法。
回答by athanassis
# xsltproc [options] stylesheet file
This program is the simplest way to use libxslt. http://xmlsoft.org/XSLT/xsltproc2.html
这个程序是使用 libxslt 的最简单方法。 http://xmlsoft.org/XSLT/xsltproc2.html
回答by OldskoolOrion
The Win32 directory has a lot of goodies, next to precompiled binaries for use on commandline.
Win32 目录有很多好东西,旁边是用于命令行的预编译二进制文件。
I'm not linking to the directory directly, since the root of the project has a rich set of tools for - good for everyone's flavor of the month :)
我没有直接链接到目录,因为项目的根目录有一套丰富的工具 - 适合每个人的本月风味:)
回答by Michael Kay
There are lots of XSLT 1.0 processors available, and a handful of XSLT 2.0 processors, and as far as I know every single one of them runs on Windows and can be called from the command line. If your problem is choosing between them, then you're going to have to tell us more about your requirements and constraints.
有很多可用的 XSLT 1.0 处理器和少数 XSLT 2.0 处理器,据我所知,它们中的每一个都在 Windows 上运行,并且可以从命令行调用。如果您的问题是在它们之间进行选择,那么您将不得不告诉我们更多有关您的要求和限制的信息。
回答by Tim
XQSharpincludes an XSLT 2.0 command line processor. See the Xslt Command Line Referencedocumentation for details.
XQSharp包括一个 XSLT 2.0 命令行处理器。有关详细信息,请参阅Xslt 命令行参考文档。
回答by George Birbilis
You can find some XSLT engine wrappers, XSLer and XSLTransform (one in Delphi and one in .NET) with source code at https://github.com/zoomicon/tranXform
您可以在https://github.com/zoomicon/tranXform找到一些带有源代码的 XSLT 引擎包装器、XSLer 和 XSLTransform(一个在 Delphi 中,一个在 .NET 中)