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:
Open the schema in the XML Editor.
If the schema is already open in the XML Editor, save any changes.
Choose from the following:
In the XML Editor, selectXML|Generate Instance Document.
In the XSD Viewer, select Schema|Generate Instance Document.
Configure the following options:
Instance Document Generation dialog
Field | Description |
---|---|
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 | Specify 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