LorikSoftware programs provide graphical template, GISLink rules and Toolbox tasks savings in XML format.
XML can be described as a generic framework for storing data whose structure can be represented as a tree.
XML documents mix markup (within <(less than) and > (greater than) characters) describing the document's structure and text describing the document's content
At the beginning, the document contains an optional declaration stating the XML version in use, the character encoding in use, and the standalone declaration:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
Document respects the specifications of XML version 1.0
Encoding is declared as UTF-8 as all XML processors accept this Unicode encoding which is the most common native Unicode encoding.
Standalone declaration set to"no" indicates that there are external declaration, that is to say references to external entities.
Among the indispensable syntactical elements, the document must contain one root element (the parent element), which means that the text is enclosed between a root start tag and its corresponding root end tag:
<LorikSoftwareTemplate>
</LorikSoftwareTemplate>
No part of this element appears in the content of any other element.
Within the root element, the document contains one or more elements (we can name them the child elements), the boundaries of which are either delimited by start-tag and end-tag or, for empty elements, by empty-element tag.
In the following example, the first line represents the start-tag while the last one represents the end-tag:
<Component uniqueID="257">
<Name>Comp. defaut</Name>
</Component>
These lines represent one element. XML elements must respect the following naming rules:
Names can contain letters, numbers and other characters but must not start with a number, a punctuation character, and the letters xml (whatever the case)
Names cannot contain spaces
To provide some additional information about the element, XML format gives the capability to add attributes to elements in the start-tag.
In the example above, the element named Component has an attribute called uniqueID whose value equals "257".
Important: attribute values must always be quoted, either in single or double quotes.
Important: these IDs are not part of the graphical template component but act as identifier to identify the components themselves.
As any other ID attribute in the graphical template XML file, they can be considered as metadata and do not have to be modified as it is a compulsory information for the program in which the user imports the graphical template.
The following example represents an empty-element tag:
<TypedScreeningList/>
Finally, some characters have a special meaning in XML format. These character will have to be replaced with entity references:
< replaces < (less than)
> replaces > (greater than)
& replaces & (ampersand)
' replaces ' (apostrophe)
" replaces "(quotation mark)
Note that some comments may be added in the XML file using the following syntax:
<!-- comment line -->
XML format was designed to transport and store data, but we strongly suggest to use this tool only as a verification tool.
In some exceptional cases, the user can "clean-up" a graphical template, deleting types he does not want to use anymore, but in any case, he has to create a graphical template from scratch.
Anyway, a graphical template exported using *.xml format from a new LorikSoftware file must at list contain the following elements to be readable in a program of the LorikSoftware range:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<LorikSoftwareTemplate>
<LKXMLVersion>1.0</LKXMLVersion>
<TemplateVersion>1.0</TemplateVersion>
<LayerList>
<Layer uniqueID="18">
<Name>Default Layer</Name>
<Component uniqueID="256">
<Name>Default Comp.</Name>
</Component>
</Layer>
</LayerList>
<InkList/>
<NamedColorList/>
<TypedCurveList/>
<TypedTextList/>
<TypedSymbolList/>
<TypedPatternList/>
<TypedSOCList/>
<TypedHatchingList/>
<TypedScreeningList/>
<TypedZigZagList/>
</LorikSoftwareTemplate>