XMLSpy uses the familiar tree view to manage multiple files or URLs in XML projects. Files and URLs can be grouped into folders by common extension or any arbitrary criteria, allowing for easy structuring and batch manipulation.
Please note: Most project-related commands are also available in the context menu, which appears when you right-click any item in the project window.
Absolute and relative paths
Each project is saved as a project file, and has the .spp extension. These files are actually XML documents that you can edit like any regular XML File. In the project file, absolute paths are used for files/folders on the same level or higher, and relative paths for files/folders in the current folder or in sub-folders. For example, if your directory structure looks like this:
If your .spp file is located in Folder3, then references to files in Folder1 and Folder2 will look something like this:
References to files in Folder3 and Folder4 will look something like this:
If you wish to ensure that all paths will be relative, save the .spp files in the root directory of your working disk.
In the Project window, a folder can be dragged to another folder or to another location within the same folder. A file can be dragged to another folder, but cannot be moved within the same folder (within which files are arranged alphabetically). Additionally, files and folders can be dragged from Windows File Explorer to the Project window.
Find in project
You can search for project files and folders using their names or a part of their name. If the search is successful, files or folders that are located are highlighted one by one.
To start a search, select the project folder in the Project sidebar that you wish to search, then select the command Edit | Find (or the shortcut Ctrl+F). In the Find dialog that pops up (screenshot below) enter the text string you wish to search for and select or deselect the search options (explained below) according to your requirements.
The following search options are available:
•Whole-word matching is more restricted since the entire string must match an entire word in the file or folder name. In file names, the parts before and after the dot (without the dot) are each treated as a word.
•It can be specified that casing in the search string must exactly match the text string in the file or folder name.
•Folder names can be included in the search. Otherwise, only file names are searched.
•External folders can be included or excluded from the search. External folders are actual folders on the system or network, as opposed to project folders, which are created within the project and not on the system.
If the search is successful, the first matching item is highlighted in the Project sidebar. You can then browse through all the returned matching items by clicking the Find Next and Find Prev buttons in the Find dialog.
If a change is made to an external folder, this change will not be reflected in the Project Window till the project is refreshed.
Global resources in the context menu
When you right-click a folder in the Project window, in the context menu that appears, you can select the Add Global Resource menu item to add a global resource. The menu command itself pops up the Choose Global Resource dialog, which lists all the file-type and folder-type global resources in the currently active Global Resources XML File. Select the required global resource, and it will be added to the selected project folder.
Projects and source control providers
If you intend to add an XMLSpy project to a source control repository, please ensure that the project file's position in the hierarchical file system structure is one which enables you to add files only from below it (taking the root directory to be the top of the directory tree).
In other words, the directory where the project file is located, essentially represents the root directory of the project within the source control repository. Files added from above it (the project root directory) will be added to the XMLSpy project, but their location in the repository may be an unexpected one—if they are allowed to be placed there at all.
For example, given the directory structure shown above, if a project file is saved in Folder3 and placed under source control:
•Files added to Folder1 may not be placed under source control,
•Files added to Folder2 are added to the root directory of the repository, instead of to the project folder, but are still under source control,
•Files located in Folder3 and Folder4 work as expected, and are placed under source control.