问题描述
我有一个 xsd 文件,并没有做太多的 xml 操作、解析等.我想要/需要为我的代码测试 xml 文件,但没有任何示例.(我是用xerces来解析的)
I have an xsd file and have not done much xml manipulation, parsing, etc. I want/need test xml files for my code but don't have any samples. (I am using xerces to parse)
这类似于:xml-instance-generation-from-xml-架构-xsd
但我真的不想让它成为一个两步过程.(python 或 java)
but I don't really want to make it a two step process. (python or java)
我只想将 xsd 文件提供给某个工具并让它生成一个示例 xml 文件.我该怎么做?
I just want to feed xsd file to some tool and have it generate a sample xml file. How can I do that?
另请参阅:如何生成样本-xml-documents-from-their-dtd-or-xsd
推荐答案
Microsoft 已发布文档生成器"工具作为示例.这篇文章描述了示例应用的架构和操作在一些细节.
Microsoft has published a "document generator" tool as a sample. This is an article that describes the architecture and operation of the sample app in some detail.
如果您只想使用文档生成工具,点击这里 并安装 MSI.
If you just want to use the doc generation tool, click here and install the MSI.
它是免费的.源是可用的.需要 .NET Framework 才能运行.仅适用于 XSD.(不是放松 NG 或 DTD).
It's free. The source is available. Requires the .NET Framework to run. Works only with XSDs. (not Relax NG or DTD).
这篇关于从 xsd 生成 xml 文件的工具(用于测试)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!