In this page, we're going to talk about a new feature that will help generate a sample XML document, given a schema.
Netbeans IDE allows users to generate XML instance documents that conform to a given XML Schema. When a XML instance document is created that conforms to a XML schema, the IDE currently creates a skeletal XML instance document with only the root element. The user then needs to edit the document and use code completion to create a valid and well formed XML instance document. This is a time consuming process. Implementing this feature will allow users to automatically create XML instance document from XML schema with a given root element. Such a feature can be useful for many purposes: to design the schema iteratively by looking at the generated XML instance, to generate XML instances as test cases for applications that consume XML.
The new feature will meet the following requirements
- The generated XML document should be valid with respect to the schema. -- Will not be implemented for 6.1
- The generation should be deterministic—that is, the same schema will generate the same instance document.
An additional panel will be added to the XML instance creation wizard that will prompt the user to edit the options for XML content generation. The sample wizard panel is attached. This will help the user customize the way in which XML documents are generated from XML schemas
A context-sensitive menu option will also be added to XSD files. This option "Generate Sample XML" will create a sample XML based on the XSD in the same location as the XSD file in the project.
<Detailed description if any>
<Limitations, open issues>