Creating a New XML File
When you create a new XML file in XMLSpy, you are given the option of basing it on a schema (DTD or XML Schema) or not. In this section you will create a new file that is based on the AddressLast.xsd schema you created earlier in the tutorial.
To create the new XML file:
1.Select the menu option File | New. The Create new document dialog opens.
2.Select the Extensible Markup Language entry (or generic XML document entry) from the dialog, and confirm with OK. A prompt appears, asking if you want to base the XML document on a DTD or Schema.
3.Click the Schema radio button, and confirm with OK. A further dialog appears, asking you to select the schema file your XML document is to be based on.
4.Use the Browse or Window buttons to find the schema file. The Window button lists all files open in XMLSpy and projects. Select AddressLast.xsd (see Tutorial introduction for location), and confirm with OK. An XML document containing the main elements defined by the schema opens in the main window.
5.Click the Grid tab to select Grid View.
6.In Grid View, notice the structure of the document. Click on any element to reduce selection to that element. Your document should look something like this:
7.Click on the icon next to Address, to view the child elements of Address. Your document should look like this:
8.Select the menu option File | Save and save it in the Tutorial folder. Give your XML document a suitable name (for example CompanyFirst.xml). Note that the finished tutorial file CompanyFirst.xml is in the Tutorial folder, so you may need to rename it before you give that name to the file you have created.