User Guide > Definition Sets > Creating a Definition Set > Creating an XML Definition Set
 
Creating an XML Definition Set
You can create an XML definition set by typing it in or by importing existing XML definitions.
To create an XML definition set from an XML file instance
1. Follow the steps in To add a new SQL, XML, or WSDL definition set, choosing XML as the type of definition set.
The XML Schema tab is displayed in the editor that opens on the right. See XML Definition Set Editor for information about the XML definition set editor toolbar buttons and panel features.
2. Enter XML schema definitions in one of three ways:
Type the XML schema definitions directly into the panel.
Import the XML schema definitions from an existing file in your file system as follows:
a. Click the Import XML Schema Definitions From File(s) button.
b. In the File Location dialog, type the full pathname to the XML file in the File field, or browse to the XML file that you want to import.
c. Optionally (in the File Location dialog), check the Show Advanced Options check box to view the connection properties and alternate location mappings for this file.
d. Click OK.
Import the XML schema definitions from an XML Instance as follows:
e. Click the Create XML Schema Definitions From XML Instance button.
Studio opens an Open dialog in which you can choose the XML file. This needs to be an XML file, not a schema.
f. Click Open.
3. In the editor, view and optionally edit the schema.
4. Use the Validate XML Schema Definitions button in the toolbar to validate the schema.
The validation process parses the XML file into a schema of element declarations and type definitions, which now appear in the XML Schema panel.
A field in the lower right corner of the panel shows the current line and column position of the cursor (separated by a colon) to help you find errors in the schema if it is found to be invalid.
5. Use the Format XML Schema Definitions button in the toolbar to format the definitions with indentation and font coloring (keywords in orange type and literal definitions in blue type).
6. Save the definition set.
You can now reference the XML definition set and all of the XML types defined in the definition set from stored procedures, XQuery procedures, and XSLT procedures. See Using an XML Definition Set.