Difference between revisions of "Parameterfile1"
Line 3: | Line 3: | ||
Don’t be scared. Even without any previous knowledge you’ll be able to understand the | Don’t be scared. Even without any previous knowledge you’ll be able to understand the | ||
xml structure used for {{lmt}} in less then half an hour. Please consult the Internet to find | xml structure used for {{lmt}} in less then half an hour. Please consult the Internet to find | ||
suitable introduction into [https://www.w3schools.com/xml/ xml]. Bare in mind that the {{lmt}} parameter file is case sensitive, that is <code>Hello</code> is not the same as <code>hello</code>. | suitable introduction into [https://www.w3schools.com/xml/ xml]. Bare in mind that the {{lmt}} parameter file is case sensitive, that is <code>Hello</code> is not the same as <code>hello</code>. It is strongly advised to use an editor which supports [https://en.wikipedia.org/wiki/Syntax_highlighting syntax highlighting], [https://en.wikipedia.org/wiki/Bracket_matching bracket matching] and [https://en.wikipedia.org/wiki/Code_folding code folding]. | ||
== Unsupported xml features == | == Unsupported xml features == |
Revision as of 10:57, 28 December 2020
The lmt parameter file must in written in “eXtensible Markeup Language” (xml). For under-
standing the examples you may want to get a jump start in xml file structure first.
Don’t be scared. Even without any previous knowledge you’ll be able to understand the
xml structure used for lmt in less then half an hour. Please consult the Internet to find
suitable introduction into xml. Bare in mind that the lmt parameter file is case sensitive, that is Hello
is not the same as hello
. It is strongly advised to use an editor which supports syntax highlighting, bracket matching and code folding.
Unsupported xml features
Currently unsupported xml features are character entities and complete empty-element tags. Further, start tags and end tags must not occur in the same line of the parameter file.
Parameter file terminology
The lmt parameter file has only two major structural components: tags and key strings. The content of each tag can be another tag or a key string.
Tag names
The tag name is the character string between the arrow brackets of a tag. For example, the tag name of <hello> is hello . Depending on the specific location and function of a tag the name can be hard-coded or user-defined(u.d.). U.d. tag names can be as short as possible. e.g. a single character, but must not contain any white space. While a tag name my contain any ascii character it is strongly recommended to use only alpha-numeric characters and underscores.
Key strings
Key strings have always the format keyword:variable . Keyword is a character string which is either hard coded or user defined. The spelling is therefore defined by the hardcoded value, or by the user, but must be abide by in any case. Variable refers to a
- a single character string, or comma-separated list of strings which may be hardcoded or user-defined, or
- a single or a comma-separated list of numeric values.
Parsing logic
lmt parse the parameter file starting at the compulsory <root> tag. Nested tags can be either automatic-compulsory, automatic-optional and nominated. Automatic-optional tags will be searched for by default and are evaluated if they are present. Their absence will not case an error message at parsing time. However, that does not mean that the information they should provide is not necessary later on and it's absence may cause an error stop. Automatic-compulsory tags will be search for by default and their absence will cause an error stop. Nominated tags are always compulsory but are only searched for if they have been nominated by a key string variable, where the key string variable becomes the tag name.
Depending on the host tag key strings can be optional or compulsory.
<root>
<nest_1>
</nest_1>
<nest_2>
<x>
</x>
others: y,z
<y>
</y>
<z>
</z>
</nest_2>
</root>
In the above example nested tags <nest_1> and <nest_2> maybe optional or compulsory, but both are automatic, that is lmt will evaluate them only if the are present. Tag <x> , nested in tag <nest_2> , is automatic and may be optional or compulsory as well. However, tags <y> and <z> are nominated and therefore compulsory. The nomination is triggered by providing key string other: y,z where the variable y,z provides a comma-separated list of names of the nominated tags. That is, after evaluating key string others: y,z lmt will search for tags <y> and <z> , and their absence will cause an error stop.
Group of mutually exclusive information sources
For the sake of flexibility the user can supply the same information in several different ways to lmt. For instance, information can be embedded in a tag for provided via a file where the variable of key string variable contains the file name . In such a case, the key string and the tag form a Group of mutually exclusive information sources (GIS). The name already implies that lmt will accept only one source of information and if it finds more than one source will stop with an error message.
Escaping tag content formatting rules
As pointed out above are the only accept tag content, and key strings must comply with a formatting rule. However, it is sometimes desirable to supply other information in a tag where that information may not comply with the formatting rule. In order to do so the tag content can be globally escaped by adding an attribute to the tag. However, this implies that by providing an attribute the whole tag content is escaped, not just a single line.