使用 Netbeans 从 XSD 创建示例 XML
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7811715/
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
Use Netbeans to Create Sample XML from XSD
提问by Josh Johnson
How do you use Netbeans to generate a sample XML file from an XSD? I see that this question has been asked beforeand it would appear that it can be done. Though, there are some reportsthat make it seem it cannot.
您如何使用 Netbeans 从 XSD 生成示例 XML 文件?我看到之前已经问过这个问题,似乎可以做到。尽管如此,有一些报道使它看起来似乎不能。
What menu or window is the option located under? I have looked under every menu as well as searched the plugins. My version of Netbeans: NetBeans IDE 7.0.1 (Build 201107282000)
该选项位于哪个菜单或窗口下?我查看了每个菜单并搜索了插件。我的 Netbeans 版本:NetBeans IDE 7.0.1(内部版本 201107282000)
回答by Jonathan Spooner
From a project that contains the .xsd:
从包含以下项目的项目中.xsd:
- Click
New Fileon the tool bar orFile > New Filefrom the menu - Choose
XML > XML Document - Name your file, click next
- Choose
XML Schema-Constrained Document, click next - Click the
Browsebutton and useBy Fileto navigate to the.xsd - Click the
Importcheck box beside the file name, click next - Review the options available and click
Finishto generate
- 单击
New File工具栏或File > New File从菜单中 - 选择
XML > XML Document - 命名你的文件,点击下一步
- 选择
XML Schema-Constrained Document,点击下一步 - 单击
Browse按钮并使用By File导航到.xsd - 单击
Import文件名旁边的复选框,单击下一步 - 查看可用选项并单击
Finish以生成
You can use more than one .xsdfile to generate the .xml. In this case it will use whichever .xsdfile you choose as Primaryto resolve any conflicts.
您可以使用多个.xsd文件来生成.xml. 在这种情况下,它将使用.xsd您选择的任何文件Primary来解决任何冲突。

