如何从XSD架构生成测试XML数据文件的集合? [重复]

时间:2022-01-14 17:17:38

Possible Duplicate:
How to generate sample XML documents from their DTD or XSD?

可能重复:如何从DTD或XSD生成示例XML文档?

Given an XSD schema, is there a means to generate a collection of XML files from this XSD schema (all of which successfully validate against that XSD schema) to be used for testing purposes?

给定一个XSD架构,有没有办法从这个XSD架构生成XML文件集合(所有这些都成功验证该XSD架构)用于测试目的?

We are creating a series of Java 6 applications which pass inputs/output using XML files. All XML files should successfully validate against one of our XSD schemas. The XSD schemas are quite complex, so creating XML files by hand for testing is prohibitive. We want a collection of testing XML files that will exercise the limits of the input data (so having a single XML data file will not be sufficient). Ideally, it would be nice to have a tool which allows a tester to pick a few values for each XML tag (the max value, the min value, a zero value, a negative value, etc) and then the tool will generate collections of XML files using combinations of those tester-chosen values.

我们正在创建一系列Java 6应用程序,它们使用XML文件传递输入/输出。所有XML文件都应该成功验证我们的XSD架构之一。 XSD架构非常复杂,因此手动创建XML文件进行测试是非常复杂的。我们需要一组测试XML文件,这些文件将限制输入数据(因此只有一个XML数据文件是不够的)。理想情况下,有一个工具允许测试人员为每个XML标签选择一些值(最大值,最小值,零值,负值等),这将是很好的,然后该工具将生成使用这些测试人员选择的值的组合的XML文件。

The system is being tested upon a Microsoft Windows XP environment, but we could certainly generate the XML testing files upon a different environment (if a particular tool could help automate this). We would like this XML-generation-from-XSD capability for testing purposes and we do not need it within the application itself, so a stand-alone XML-generation tool could be used (if one exists).

该系统正在Microsoft Windows XP环境中进行测试,但我们当然可以在不同的环境中生成XML测试文件(如果某个特定工具可以帮助自动执行此操作)。我们希望这种XML-generation-from-XSD功能用于测试目的,我们在应用程序本身内不需要它,因此可以使用独立的XML生成工具(如果存在)。

related question: It seems that the only existing tool I found that even attempts this task is jCAM (main project site is at http://sourceforge.net/projects/camprocessor/; list of jCAM capabilities and tutorial available at https://www.oasis-open.org/committees/download.php/29661/XSD%20and%20jCAM%20tutorial.pdf). Other than the tutorial, I have not investigated this tool yet. Does anyone have experience with this tool?

相关问题:似乎我发现的唯一现有工具即使尝试此任务也是jCAM(主项目站点位于http://sourceforge.net/projects/camprocessor/; jCAM功能列表和教程可在https://获得www.oasis-open.org/committees/download.php/29661/XSD%20and%20jCAM%20tutorial.pdf)。除了教程之外,我还没有调查过这个工具。有没有人有这个工具的经验?

1 个解决方案

#1


0  

I have not used it in a while, but I know that Altova XmlSpy used to do this. You can get a free download or trial version of it (with 30 days of trial period) and give it a shot.

我有一段时间没有使用它,但我知道Altova XmlSpy曾经这样做过。你可以获得它的免费下载或试用版(30天的试用期)并试一试。

http://www.altova.com/xml-editor/

#1


0  

I have not used it in a while, but I know that Altova XmlSpy used to do this. You can get a free download or trial version of it (with 30 days of trial period) and give it a shot.

我有一段时间没有使用它,但我知道Altova XmlSpy曾经这样做过。你可以获得它的免费下载或试用版(30天的试用期)并试一试。

http://www.altova.com/xml-editor/