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:
- Right-click the XML Documents folder
in your data development project, and select . The Create
XML File wizard opens.
- Select the XMLSchema project in the parent folder field,
type customer.xml in the File name field,
and click Next.
- Select Create XML file from an XML schema file,
and click Next.
- On the next page, select the customer.xsd file from the
tree, and click Next.
- 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.
- 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.
- Expand the elements in the XML editor Design view tree.
- 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.
- Save the changes.