![]() |
Previous Top Next |
Creating and completing a new XML file
|
1. | Select the menu option File | New, and select the .xml XML Document entry from the dialog, then confirm with OK.
|
![]() |
A prompt appears, asking if you want to base the XML document on a DTD or Schema.
|
2. | 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.
|
3. | Use the Browse or Window buttons to find the schema file, in our case the AddressLast schema, and confirm the selection with OK.
|
![]() |
An XML document containing the main elements defined by the schema, opens in the main window. XML documents are automatically opened in the Enhanced Grid View.
|
|
Please note:
|
XML Spy tries to find the root element of a schema automatically. The "Select a root element" dialog box is opened, if it is unclear which is the root element. You can then select the root element manually.
|
![]() |
4. | Click on any element to deselect the data.
|
5. | Click on the ![]() |
![]() |
1. | Right click the Name element, and select Insert | Attribute from the context menu.
|
An attribute field is added to the Address element, and a popup containing xsi:type automatically opens.
|
![]() |
2. | Hit the "Tab" key to move into the next field.
|
3. | Select US-Address from the drop-down list, and confirm with Enter.
|
![]() |
Please note:
|
The xsi prefix allows you to use special XML Schema related commands in your XML document instance. Please see the W3C website at http://www.w3.org/TR/2001/REC-xmlschema-0-20010502 for more information.
|
1. | Double click in the Name value field (or use the arrow keys) and enter "US dependency", confirm with Enter.
|
![]() |
2. | Use the same method to enter a Street and City name (e.g. Noble Ave. and Dallas).
|
3. | Click the Person element, and hit the "Del" key to delete it (we will add it again in a few moments in the Text view!).
|
4. | Click on any Address element to deselect the elements.
|
Your XML document should look like this:
|
![]() |
|