Skip to main content

Defining Schema for XML File

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 definition file from the Clausion server installation folder location FPM.Share/DataTemplate/Schema/definition.xsd. This file can be used to validate the correctness of the definition 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 is updated. Otherwise the new elements and attributes added in the new Clausion 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 definition 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.

Leaving the schema definition in the definition file is fine while importing it to Clausion, even though the file references a non-existent file on the Clausion server. Clausion always uses its own XML schemas in the server installation folder FPM.Share/DataTemplate/Schema for validation.

Was this article helpful?

We're sorry to hear that.