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 Extensible Markup Language 1.0 and confirm with OK. The Choose Schema or DTD dialog appears.
3.Click Assign Schema/DTD File.
4.In the dialog that appears, use either the Browse button or Window button to find the schema file. (The Window button lists all files currently open in XMLSpy.) 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.