You can generate a sample XML document instance that uses elements and attributes defined in an XML schema. For example, you may need a document instance to test services that operate on documents using the schema. You can generate document instances using the XML Editor or the XSD Viewer.
To generate a document instance:
If the schema is not open in the XML Editor or XSD Viewer, open it as described here. If the schema is already open in the XML Editor, save any changes.
If you are using the XML Editor, choose XML | Generate Instance Document. If you are using the XSD Viewer, choose Schema | Generate Instance Document.
Configure the following options in the Instance Document Generation dialog:
Root Element: Specify which element should be the root element.
Create Optional Elements: Specify whether to create child elements in parent element instances where they are optional .
Create Optional Attributes: Specify whether to add values for optional attributes.
Repeat Count: Specifies how many instances of an element to add in contexts where the schema allows repeating elements.
Click OK to generate the document instance.
The generated document instance appears in a new XML Editor window.
Generated documents are read-only and are not created in the file system. To create a persistent copy, choose File | Save As to save them to disk. You can edit the text after saving to disk.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com