19
votes

How do you use Netbeans to generate a sample XML file from an XSD? I see that this question has been asked before and it would appear that it can be done. Though, there are some reports that make it seem it cannot.

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)

1

1 Answers

32
votes

From a project that contains the .xsd:

  1. Click New File on the tool bar or File > New File from the menu
  2. Choose XML > XML Document
  3. Name your file, click next
  4. Choose XML Schema-Constrained Document, click next
  5. Click the Browse button and use By File to navigate to the .xsd
  6. Click the Import check box beside the file name, click next
  7. Review the options available and click Finish to generate

You can use more than one .xsd file to generate the .xml. In this case it will use whichever .xsd file you choose as Primary to resolve any conflicts.