简体   繁体   English

批量生成示例XML以加载XSD文件

[英]Batch generating sample xml for loads for XSD files

I need to generate sample xml from xsd for testing prupose and XMLSpy does the job nicely ! 我需要从xsd生成示例xml以进行测试,而XMLSpy可以很好地完成这项工作!

But I don't want to do it one by one, I want to be able to do it in batch as I have loads for XSD files also whenever I made some changes to those XSD files, I want to be able to easily generate xml from XSD files again. 但是我不想一个接一个地做,我想能够批量做,因为我对XSD文件进行了更改时也加载了XSD文件,所以我希望能够轻松生成xml再次从XSD文件。

Is there any API there for this job ? 是否有用于此工作的API? C++, C#, java, python I don't care as long as it works. C ++,C#,java,python我不在乎,只要它能工作即可。

Or is there any easy way of doing it ? 还是有任何简单的方法吗?

BTW I know I can use xsd tool to generate c# class then write a few line of c# code to provide some data to generate xml, but this way I need to provide data for each XSD which I really don't want to ... 顺便说一句,我知道我可以使用xsd工具生成c#类,然后编写几行c#代码以提供一些数据来生成xml,但是这种方式我需要为每个我真的不想提供的XSD提供数据。

Thanks in advance. 提前致谢。

You can use the xsd2inst command from the open-source Java project XMLBeans 您可以从开源Java项目XMLBeans中使用xsd2inst命令

Usage is here . 用法在这里

Also check out this: How to generate sample XML documents from their DTD or XSD? 还请检查以下内容: 如何从其DTD或XSD生成示例XML文档?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM