This part contains the description of the XML file structure for saving (export) of the configuration (development) data of the PROMOTIC system.
A general XML document consists of so-called "tags"
. It is a word closed in the brackets followed by a tag content and completed by the end sign of the tag, for example:
<Prop> .. tag content .. </Prop>
The tag content can be empty (then the whole tag can be written in short, for example. <Prop/>
), there can be a plain text or there can be other tags included in it. There can be more tags on the same level (consecutively), it is also possible to nest them into arbitrary level. Every tag can have so-called attributes that are written, for example, as follows (the attribute is Name
in this case):
<Prop Name="PmNumber"> .. tag content .. </Prop>
The PROMOTIC system uses the XML data structure on many places (see e.g. XML data sharing
in the runtime mode). We'll describe the XML structure for saving the development data here.
The tag can be here, for example, the object of the PROMOTIC system - in this case it includes in itself more tags representing e.g. properties of this object.
For example, in the following text the Content tag includes the PmObject tag that consists from two Prop tags.
<PmObject Type="PmNumber" Name="number0" Import="XXX" Defimport="XXX">
Here the tag <Prop Name="Value">100</Prop>
means that the property named Value
has the value 100
Structure of XML PROMOTIC document is as follows
<?xml version="1.0" encoding="utf-8"?>
<Document CfgSelect="XXX" Load="XXX">
<Cfg Name="NameCfg1" Src="XXX">
<Dst Ctx="XXX" Defimport="XXX" Import="XXX" />
<PmObject Type="PmNumber" Name="Number0" Import="XXX" Defimport="XXX">
: The file is logically sectioned into configurations <Cfg>
. These can be more in the file. On import in the development environment PROMOTIC, it is possible to select which configuration to read or it is also possible to read all configurations. The data themselves are placed in the configuration inside the <Content>
The behavior of the whole document and each configuration can be affected on import in the description of the structure by mentioned attributes.
Note 2: The XML document (not only the PROMOTIC XML document) is "case-sensitive", i.e. IT IS NECESSARY to keep upper- and lower-case letters in the names of tags and attributes.
Note 3: <?xml version="1.0" encoding="utf-8"?> is generated by the PROMOTIC and it is mandatory. It is the identification that it goes about the XML file.
Description of Document tag: (this tag is mandatory)
CfgSelect="First" means that only the first configuration that suits to the context position, is selected from the file and there is no continuation
If not set, then all configurations in the file are imported (depending on Dst, see further)
Load="Auto": the import passes without an interactive part
Load="Interactive": (default) the interactive procedure (with questions)
Description of Cfg tag: (this tag is mandatory)
Attribute Name="NameCfg": the name of the configuration.
Attribute Src="Promoticdata.xml" (optional): Promoticdata.xml is the name of the external file (keeping the XML file structure described here) that is read by the PROMOTIC system on reading the NameCfg configuration (in this case the data from the Content tag are NOT read). If not set, then the data from the Content tag are read.
Description of Dst tag: (this tag is optional)
Specifies the validity of the configuration context in dependency on the object into which it is imported. There can be more <Dst>
tags in the configuration.
: the name of the tag class, for example:
is the tag of the Gpanel class, in this case Ctx="GPanel" would mean:
- if this configuration was imported into the panel, then it is valid.
- if this configuration was imported into the graphic item or, for example, into the PROMOTIC object, then it is INvalid and the import of this configuration is not performed.
If <Dst> is not stated in the XML file, then the configuration is always valid.
(optional): Except the <Dst>
tag it is possible to define this attribute at any tag. It specifies how to import all subtags except the stated tag.
Defimport="IfNotExist" - subtags are imported only if they don't exist
Defimport="IfExist" - subtags are imported only if they exist
Defimport="Replace" - if the subtag exists, then it is imported; if it doesn't exist, then it is created and imported
Defimport="Add" - subtags always created as new ones and then they are imported (names are kept according the XML document)
Defimport="AddWithNewName" - subtags always created as new ones and then they are imported (names are newly created)
Defimport="RemoveAndNew" - if subtags don't exist, then they are created and imported; if they exist, then they are deleted, new ones are created and finally imported
Defimport="Remove" - all subtags are deleted
Defimport="No" - no subtags are imported
Defimport="NoThis" - subtags are not imported if not stated (by setting DefImport, Import)
Attribute Import="XXX" (optional): Except the <Dst> tag it is possible to define this attribute at any tag. It specifies how to import the tag where this attribute is stated. XXX takes the same meanings as the Defimport.
: The Import
attributes for configurations where they are not explicitly stated in the <Dst>
section, are specified in the window for the import by the "Import type" option. If they are stated on both places, then attributes in the <Dst>
section of the XML file have precedence.
Description of Content tag: (this tag is mandatory)
This tag contains solitary PROMOTIC data.