Building a Project
Having come to this point in the tutorial, you will have a number of tutorial-related files open in the Main Window. You can group these files into a tutorial project. First you create a new project and then you add the tutorial files into the appropriate sub-folders of the project.
Create a new project
Create a new project as follows:
1.Select the menu option Project | New Project. A new project folder called New Project is created in the Project Window (screenshot below). The new project contains empty folders for typical categories of XML files.
2.Click the CompanyLast.xml tab to make the CompanyLast.xml file the active file in the Main Window.
3.Select the menu option Project | Add Active and Related Files to project. Two files are added to the project: CompanyLast.xml and AddressLast.xsd. The XML file is added to the XML subfolder because it is the active file. The schema file is added to the DTD/Schemas folder because a reference to it is contained in the XML file, making it a related file. Note that files referenced with processing instructions, such as XSLT files, do not qualify as related files.
4.Select the menu option Project | Save Project and save the project under the name Tutorial.
Note: | Folders (but not the project) each have a property named File extensions. This is a list of file extensions separated by semi-colons (for example, xml;svg;wml). This list determines what files are added to which folders when files are added to a project. For example, when active and related files are added to a project, as done above, the File extensions properties of the folders determine into which folders the added files will be placed. |
Project and folder properties
Properties (such as the schema for validation and the XSLT for transformation) can be set not only on the entire project, but also on individual folders. You can then carry out actions, such as validation and transformation, on the entire project or individual folders. To carry out an action, right-click the project or folder, and select the action you want to carry out from the context menu that appears.
Note the following points:
•A property that is set on a folder overrides the same property of the project.
•If a property is set on the project, it is applied to all folders that do not have the same property set.
•If an action is carried out on a project, it is applied to all applicable file types in all folders of the project. For example, if a validation is carried out on a project, the validation is run on all XML files in all folders of the project. In this case, the schema that has been set for the project is used for all validations, except for XML files that are in folders which have the schema validation property set to some other schema.
Adding files to the project
You can add other files to the project as well. Do this as follows:
1.Click on any open XML file (.xml file extension) other than CompanyLast.xml to make that XML file the active file. (If no other XML file is open, open one or create a new XML file.)
2.Select the menu option Project | Add Active File to Project. The XML file is added to the XML Files folder on the basis of its .xml file type.
3.In the same way, add an HTML file and XSD file (say, the Company.html and AddressFirst.xsd files) to the project. These files will be added to the HTML Files folder and DTD/Schemas folder, respectively.
4.Save the project, either by selecting the menu option Project | Save Project, or by selecting any file or folder in the Project Window and clicking the Save icon in the toolbar (or File | Save).
Note: | Alternatively, you can right-click a project folder and select Add Active File to add the active file to that specific folder. |
Other useful commands
Here are some other commonly used project commands:
•To add a new folder to a project, select Project | Add Project Folder to Project, and insert the name of the project folder.
•To delete a folder from a project, right-click the folder and select Delete from the context menu.
•To delete a file from a project, select the file and press the Delete key.