xml spy
Previous  Top  Next
New...

ic_new

The "New..." command is used to create a new document with XML Spy. You are presented a list of predefined document types that you can create:

43_file_new  

Since XML is such a versatile and universal concept, there are many different kinds of XML documents that you can create and edit with XML Spy.

Creating files not available in the "Create new document" dialog box
If the document you want to create is not listed, simply select ".xml" and change the file extension when you save the file. You can also add new file types to this list using the Tools | Options | File types tab.

Creating new templates

You can create your own templates which will then appear in the "Create new document" dialog box when you select the File | New command.

1.Use MS Explorer or any other text editor to open one of the new.xxx template files in the ..\Altova\XML SPY Suite\Template folder. This file will act as the basis for your new XML template.  
2.Make the necessary changes, declarations etc., to new template file.  
3.Use Save as... option to save the file using the convention, Anyname.XXX  
Anyname is the name of your personal template (e.g my-xml).  
.XXX is the extension it should appear under in the dialog box (e.g. .XML). You can enter any type of XML extension here (.vml, .math etc.!)  
4.Select File | New to select your new XML template.  

43_file_new_template     

Please note:  
To delete a template, delete the template file you created.  
 
Assigning a DTD / Schema to a new XML document
XML Spy contains built-in templates for most XML-based document types and automatically provides you with a meaningful starting point instead of a totally empty file (e.g. a ".xhtml" file automatically includes the correct DOCTYPE reference to the XHTML DTD as well as an empty <html> element to start with).

The predefined templates are placed in the \Template directory, automatically created one level below the XML Spy installation directory. You can only assign a DTC/Schema to a document from within the Enhanced Grid view.

If you select the ".xml XML Document" entry, (typically a new XML instance document) in the above dialog box, XML Spy prompts you for a DTD or Schema for the new file to be based upon:

ref_p123a  

To create an empty XML document:

·Select the File | New menu entry, and  
·Click the "Cancel" button in the New file dialog box, which prompts for a DTD/Schema.  

Defining the root element
If you want to assign a DTD / Schema and the content model of the Schema or DTD contains more than one potential root element candidate, XML Spy asks you to select a root element from the list of possible candidates:

ref_p123b  

The new document is created with this element as its document root.

Previous  Top  Next

© 2002 Altova