<< Click to display table of contents >>
An XML schema is a technical guidance file which tells how to construct a valid XML file. A schema file always has a file extension ".xsd". These files define the set of valid element names, attribute names, values for attributes and the overall structure of the document.
You can find the XML schema for the template definitions file from the Clausion FPM server installation folder location FPM.Share/DataTemplate/Schema/definition.xsd. This file can be used to validate the correctness of the definitions file. You can save this file in your preferred folder on the computer which you use to edit the definitions. Please note that you should update the schema file each time Clausion FPM is updated. Otherwise the new elements and attributes added in the new Clausion FPM version will not work.
To define the schema used in the XML file, add the following attributes (xmlns:xsi and xsi:schemaLocation) to the <fpm> element start tag. This example expects that you have saved the copied schema file in folder C:\FPM\xml_schema. Note that the path is written in URL format:
<fpm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://fpm.clausion.com file:///C:/FPM/xml_schema/definition.xsd">
Some XML editors will also let you validate your definitions file without this fixed schema definition in the root element. However, it is faster if you have defined it. If the path to XML schema is incorrect, the file will not be validated.
Figure 3: An XML editor suggesting elements based on the defined XML schema (screenshot is from Visual Studio Code with Red Hat XML extension)
Leaving the schema definition in the definitions file is fine while importing it to Clausion FPM, even though the file references a non-existent file on the Clausion FPM server. Clausion FPM always uses its own XML schemas in the server installation folder FPM.Share/DataTemplate/Schema for validation.