| Note: | This vtm release is not compatible with previous versions. |
|---|---|
| The settings file has changed significantly due to the introduction of Pure XML with dynamic element referencing and templating. |
Known issues
- Configuration merging is broken: items that should just be updated are duplicated.
Changes
- Implement setting inheritance, #330
- All text values in settings must now be quoted. All unquoted text values are now considered references.
- All boolean values in settings now require an explicit value.
- Remove
<config/desktop/taskbar/menu/item/alias>attribute in settings. - Add a
Restartbutton to the terminal window menu.
Introduce Pure XML
Pure XML
Key differences from classical XML
- Document encoding is UTF-8.
- Any Unicode characters are allowed, including the U+0000 (null) character.
- There is no support for named XML character entities.
- The stored data forms a hierarchical list of
name=valuepairs. - Multiple root elements are allowed.
- There is no distinction between XML-attribute and XML-element, i.e. any attributes are sub-elements.
- Each element can be defined in any way, either using an XML-attribute or an XML-element syntax:
<... name="value" />,<...> <name> "value" </name> </...>, and<...> <name="value" /> </...>have the same meaning.
- The XML-attribute
paramin<name param="value"/>and the XML-elementparamin<name> <param="value"/> </name>are semantically identical sub-elements of thenameelement.
- Each element can be defined in any way, either using an XML-attribute or an XML-element syntax:
- No spaces are allowed between the opening angle bracket and the element name:
… < name …,... <= ...,... << ...are treated as parts of the element's value content.
- Every element has its own text value.
- For example,
<name="names_value" param="params_value"/>- thenameelement has the text valuenames_value, and itsparamsub-element has the text valueparams_value.
- For example,
- All stored values are strings (the data requester decides on its side how to interpret it):
name=2000andname="2000"have the same meaning.
- All value strings, except those that begin with a decimal digit character (ASCII
0-9), must be quoted with either double or single quotes ("U+0022 or'U+0027). - The value string can be fragmented. Fragments can be placed after the equal sign following the element name, as well as between the opening and closing tags.
- The fragments placed between the opening and closing tags can be either quoted or in raw form. The quoted form sets strict boundaries for the string value. The raw form pulls all characters between the opening and closing tags, including line breaks.
- The following compact syntax for elements is allowed:
<node0/node1/thing name="value"/>and<node0><node1><thing name="value"/></node1></node0>have the same meaning.
- Elements can reference any element using relative and absolute references, in the form of an unquoted name or an XML path to the referenced element.
thing2refers to the value/node1/thing1in<node1 thing1="value1"/><node2 thing2=/node1/thing1 />.thing2refers to the valuething1within the scope of<node1 thing1="value1"><node2 thing2=thing1 /></node1>.- Circular references are silently ignored.
- //todo describe the order in which references are resolved.
- The element reference pulls all of the element's contents, including the element's value and all nested sub-elements.
- The element's text value may include any number of substrings, as well as references to values of other elements, combined in the required order using the vertical bar character ASCII 0x7C
|.<thing1="1"/><thing2="2"/><thing21=thing2 | thing1/>and<thing1="1"/><thing2="2"/><thing21="21"/>have the same meaning.
- Documents containing identical data structures allow overlaying.
- The values of single elements of the original structure will be updated to the values of the overlaid structure.
- A list of elements with the same name within a scope may start with an empty element with an asterisk at the end of the name, meaning that this list will always overwrite the existing one during overlaying.
- The destination list will be pre-cleared if any of the following conditions are met:
- the first element in the overlay list is marked with an asterisk
- the first element in the destination list is not marked with an asterisk
- There is a list of escaped characters with special meaning:
\aASCII 0x07 BEL\tASCII 0x09 TAB\nASCII 0x0A LF\rASCII 0x0D CF\eASCII 0x1B ESC\\ASCII 0x5C Backslash\uA Unicode escape sequence in the form\u{XX...}or\uXX..., whereXX...is the hexadecimal codepoint value.
To illustrate possible structural designs, consider the following hierarchy of elements:
- <document> - Top-level element
- <thing> - Second level element
- <name> - Third level element
- <thing> - Second level element
The following forms of element declaration are equivalent:
- Using classical XML syntax:
<document> <thing name="a">text1</thing> <thing name="b">text2</thing> </document>
- Assigning a content value to an element directly using the equal sign:
<document> <thing="text1" name="a"/> <thing="text2" name="b"/> </document>
- Assigning a value to an element using quoted literals between the opening and closing tags:
<document> <thing name="a"> "text1" </thing> <thing name="b"> "text2" </thing> </document>
- Assigning values to sub-elements directly using the equal sign:
<document> <thing> "text1" <name="a"/> </thing> <thing> <name="b"/> "text2" </thing> </document>
- Fragmenting the assigned value strings:
<document> <thing="t"> "ext" <name> "a" </name> "1" </thing> <thing> <name> "b" </name> "text" "2" </thing> </document>
- Referencing the string value from the independent element:
<document> <basename="a"/> <thing name=basename>text1</thing> <thing name="b">text2</thing> </document>
- Referencing the string value and existing sub-elements from the independent element:
<document> <basething="text1" name="a"/> <thing=basething/> <thing name="b">text2</thing> </document>
- Referencing the string value fragment and sub-elements from the independent element:
<document> <basething="1" name="a"/> <thing="text" | basething/> <thing name="b">text2</thing> </document>
- Referencing the string value fragment and sub-elements from the independent element:
<document> <basething="text" name="a"/> <thing=basething | "1"/> <thing name="b">text2</thing> </document>
- Referencing element from outer scope:
<basething name="a"/> <document> <thing=basething | "text1"/> <thing name="b">text2</thing> </document>
- Referencing the string value fragments between opening and closing tags:
<basething="xt" name="a"/> <document> <thing> "te" | basething | "1" </thing> <thing name="b">text2</thing> </document>
- Parameterized templating:
<ThingTemplate = "text" | NumberRef> <name = LetterRef/> </ThingTemplate> <document> <thing=ThingTemplate NumberRef="1" LetterRef="a"/> <thing=ThingTemplate NumberRef="2" LetterRef="b"/> </document>
- Parameterized templating from an external namespace:
<Namespace> <ThingTemplate = "text" | NumberRef> <name = LetterRef/> </ThingTemplate> </Namespace> <document=Namespace> <thing=ThingTemplate NumberRef="1" LetterRef="a"/> <thing=ThingTemplate NumberRef="2" LetterRef="b"/> </document>
