Altova XMLSpy 2025 Professional Edition

Creating a New XML File

Home Prev Top Next

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.

XSTutXMLCreateNewXML

2.Select Extensible Markup Language 1.0  and confirm with OK. The Choose Schema or DTD dialog appears.

XSFileNewAssignSchema

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:

tut_36a

7.Click on the ic_expand_elem icon next to Address, to view the child elements of Address. Your document should look like this:

tut_36b

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.

 

© 2018-2024 Altova GmbH