< Previous | Next >

Creating an XML file from an XSD file

In this lesson, use the XSD file that you created earlier as a template for a new XML file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and that contains at least some of the elements and attributes in your XML schema.

To create an XML file from an XSD file:

  1. Right-click the XML Documents folder in your data development project, and select New > XML. The New XML File wizard opens.
  2. Select the XMLSchema project in the parent folder field, type customer.xml in the File name field, and click Next.
    Screen capture showing the Create XML wizard, as described.
  3. Select Create XML file from an XML schema file, and click Next.
  4. On the next page, select the customer.xsd file from the tree, and click Next.
  5. Keep the defaults on the Select Root Element page. The customerinfo element should be selected in the Root element field. The root element of an XML file is the element that contains all other elements in that file.
  6. Click Finish. The customer.xml file opens in the XML editor, and is also displayed in the XML Documents folder of your data project.

    Now, use the XML editor to add more meaningful data.

  7. Expand the elements in the XML editor Design view tree.
  8. Highlight the data in an element, and modify the default data values. For example, change the p:name value to Joe Smith, or change the default address data.
    Screen capture showing the XML editor with modified default data values, as described.
  9. Save the changes.
< Previous | Next >

Feedback