有什么工具可以从 XML 实例文档生成 XSD 模式? [英] Any tools to generate an XSD schema from an XML instance document?
问题描述
我正在寻找一种工具,它可以获取 XML 实例文档并输出相应的 XSD 架构.
I am looking for a tool which will take an XML instance document and output a corresponding XSD schema.
我当然认识到,与手动创建架构相比,生成的 XSD 架构会受到限制(它可能无法处理可选或重复元素,或数据约束),但它至少可以作为一个快速起点.
I certainly recognize that the generated XSD schema will be limited when compared to creating a schema by hand (it probably won't handle optional or repeating elements, or data constraints), but it could at least serve as a quick starting point.
推荐答案
Microsoft XSD 推理工具 是一个很好的免费解决方案.许多 XML 编辑工具,例如 XmlSpy(@Garth Gilmour 提到)或 OxygenXML Editor 也具有该功能.不过,它们相当昂贵.BizTalk Server 也有一个 XSD 推断工具.
the Microsoft XSD inference tool is a good, free solution. Many XML editing tools, such as XmlSpy (mentioned by @Garth Gilmour) or OxygenXML Editor also have that feature. They're rather expensive, though. BizTalk Server also has an XSD inferring tool as well.
我刚刚发现了 .net XmlSchemaInference 类,所以如果你使用 .net,你应该考虑这一点
edit: I just discovered the .net XmlSchemaInference class, so if you're using .net you should consider that
这篇关于有什么工具可以从 XML 实例文档生成 XSD 模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!