如何将 xml 文件转换为 html 格式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9075045/
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
how to convert an xml file to html format?
提问by Mohnish
i am working on project that takes an xml document as an input and give the output in an html form.i have to apply a style sheet on xml document to get this output.so anyone having any info about it,please share with me
我正在研究以 xml 文档作为输入并以 html 形式提供输出的项目。我必须在 xml 文档上应用样式表才能获得此输出。所以任何人都知道有关它的任何信息,请与我分享
回答by sharmila
Please checkout these links below.
请查看下面的这些链接。
http://www.codeproject.com/Articles/12047/How-to-Convert-XML-Files-to-HTML
http://www.codeproject.com/Articles/12047/How-to-Convert-XML-Files-to-HTML
http://www.htmlgoodies.com/beyond/xml/converting-xml-to-html-using-xsl.html
http://www.htmlgoodies.com/beyond/xml/converting-xml-to-html-using-xsl.html
回答by MVnD3X
xsltproc is a command line tool for applying XSLT stylesheets to XML documents. This tool is available on UNIX and windows platform. Following command can be used to convert the document. So depending upon the lang which you are using you can find the way to incorporate this command into your project.
xsltproc 是一个命令行工具,用于将 XSLT 样式表应用于 XML 文档。此工具可在 UNIX 和 Windows 平台上使用。以下命令可用于转换文档。因此,根据您使用的语言,您可以找到将此命令合并到您的项目中的方法。
xsltproc input_file.xml -o output_file.html
回答by zhaixiaohu
Two kinds of methods can be XML to Html: the first is the Javascript Html output; the second is the use of XSLT language, XML content into the Html display.
有两种方法可以将XML转Html:第一种是Javascript Html输出;二是使用XSLT语言,将XML内容转化为Html显示。
回答by samsmith
There are so many software and websites available on the Internet but you can use Unicode.org website. In this website you have to choose the HTML to XML option from the wizard and choose the file and click OK. It will show you the XML code.
互联网上有很多可用的软件和网站,但您可以使用 Unicode.org 网站。在此网站中,您必须从向导中选择 HTML 到 XML 选项并选择文件并单击确定。它将向您显示 XML 代码。

