使用 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 14:59:58  来源:igfitidea点击:

Use Netbeans to Create Sample XML from XSD

xmlnetbeansxsd

提问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

  1. Click New Fileon the tool bar or File > New Filefrom the menu
  2. Choose XML > XML Document
  3. Name your file, click next
  4. Choose XML Schema-Constrained Document, click next
  5. Click the Browsebutton and use By Fileto navigate to the .xsd
  6. Click the Importcheck box beside the file name, click next
  7. Review the options available and click Finishto generate
  1. 单击New File工具栏或File > New File从菜单中
  2. 选择 XML > XML Document
  3. 命名你的文件,点击下一步
  4. 选择XML Schema-Constrained Document,点击下一步
  5. 单击Browse按钮并使用By File导航到.xsd
  6. 单击Import文件名旁边的复选框,单击下一步
  7. 查看可用选项并单击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来解决任何冲突。