Working with rules and generating a new xml file.
- 1. Rules.
- They can be used in generating a new xml file.
- The new rule form will appear after clicking on the symbol "+" in the table header.
- "Name" is the name of the rule, according to which the rule can be added when creating a new xml file.
- "Action" is applied to the input (tag or attribute of the input xml file or memory variable) and generates the output (tag or attribute of the output xml file or memory variable), the action parameters are columns "Input 1" and "Input 2".
- "Memory source" if it is defined, as the source a memory variable with the appropriate name is used. If it is not defined, the source is a tag or attribute of the input file.
- "Memory destination" if it is defined, as the destination a memory variable with the appropriate name is used. If it is not defined, the target is a tag or attribute of the input file.
- "Input 1" is used as the 1st parameter for the action, depending on the selected action. A memory variable can be used here (it starts here with characters ^^ a and ends with characters $$, e.g. the variable "x" will be considered as the variable "^^x$$" in this column).
- "Input 2" is used as the 2nd parameter for the action, depending on the selected action. A memory variable can be used here (it starts here with characters ^^ a and ends with characters $$, e.g. the variable "x" will be considered as the variable "^^x$$" in this column).
- "nop" nothing (no operation). Usage:
- Rule "a" fills the memory variable "x" from the tag or attribute of the input xml file.
Name Action Memory source Memory destination Input 1 Input 2 a nop x - Rule "b" writes the value of the memory variable "x" to the value of a tag or attribute of the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 b nop x
- Rule "a" fills the memory variable "x" from the tag or attribute of the input xml file.
- "string-length" the length of the string. Usage:
- Rule "c" finds out the length of the string of the tag or of the attribute of the input xml file and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 c string-length - Rule "d" finds out the string length of memory variable "x" and writes the value to memory variable "x".
Name Action Memory source Memory destination Input 1 Input 2 d string-length x x - Rule "e" finds out the string length of the memory variable "x" and writes the value to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 e string-length x - Rule "f" writes the memory variable "x" from the length of the tag string or the attribute of the input xml file.
Name Action Memory source Memory destination Input 1 Input 2 f string-length x
- Rule "c" finds out the length of the string of the tag or of the attribute of the input xml file and writes it to the output xml file.
- "string-pos" determines the position of a substring in a string. The search string is entered as "Input 1". If "Input 2" is empty,
the result is the number of occurrences of the string. If "Input 2" is a positive number (n), the result is the position of the nth occurrence of the string. Similarly, if "Input 2" is a negative number,
but the nth position of occurrence is calculated from the end of the string. The occurrence is numbered from 0. If there is no position for the occurrence of the string, the result is -1. Usage:
- Rule "f1" detects the number of occurrences of the string "aaa" in a tag or attribute of the input xml file and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 f1 string-pos aaa - Rule "f2" returns the position of the 1st occurrence of the string "aaa" in the tag or attribute of the input xml file and writes to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 f2 string-pos aaa 0 - Rule "f3" returns the position of the 1st occurrence of the string "aaa" in the tag or attribute of the input xml file from the end and writes to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 f3 string-pos aaa -1 - Using memory variables is like "string-length" or "string-replace".
- Rule "f1" detects the number of occurrences of the string "aaa" in a tag or attribute of the input xml file and writes it to the output xml file.
- "string-trim" removing spaces at the beginning or at the end. Usage:
- Rule "b1" and "b2" removes spaces at the beginning and end of a tag or attribute of an input xml file and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 b1 string-trim b2 string-trim 1 1 - Rule "q1" removes spaces at the beginning of a tag or attribute of an input xml file and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 q1 string-trim 1 - Rule "q2" removes spaces at the end of a tag or attribute of an input xml file and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 q2 string-trim 1 - Using memory variables is like "string-length" or "string-replace".
- Rule "b1" and "b2" removes spaces at the beginning and end of a tag or attribute of an input xml file and writes it to the output xml file.
- "string-toupper" change case to uppercase. Usage:
- Rule "b3" changes the case of the tag or attribute of the input xml file to uppercase and writes it to the output xml file. "Input 1" and "Input 2" are ignored.
Name Action Memory source Memory destination Input 1 Input 2 b3 string-toupper - Using memory variables is like "string-length" or "string-replace".
- Rule "b3" changes the case of the tag or attribute of the input xml file to uppercase and writes it to the output xml file. "Input 1" and "Input 2" are ignored.
- "string-tolower" change case to lowercase. Usage:
- Rule "b4" changes the case of the tag or attribute of the input xml file to lowercase and writes it to the output xml file. "Input 1" and "Input 2" are ignored.
Name Action Memory source Memory destination Input 1 Input 2 b4 string-tolower - Using memory variables is like "string-length" or "string-replace".
- Rule "b4" changes the case of the tag or attribute of the input xml file to lowercase and writes it to the output xml file. "Input 1" and "Input 2" are ignored.
- "string-substr" get a substring. Usage:
- Rule "b5" gets a substring from a string from the 2nd position of a character (numbered from 0) in the number of 4 characters. "Input 1" is the start position,
"Input 2" is the number of characters (if empty, the string from the start position to the end will be returned). "Input 1" and "Input 2" can also be negative numbers.
Name Action Memory source Memory destination Input 1 Input 2 b5 string-substr 2 4 - Using memory variables is like "string-length" or "string-replace".
- Rule "b5" gets a substring from a string from the 2nd position of a character (numbered from 0) in the number of 4 characters. "Input 1" is the start position,
"Input 2" is the number of characters (if empty, the string from the start position to the end will be returned). "Input 1" and "Input 2" can also be negative numbers.
- "string-replace" replaces a string with another string. Usage:
- Rule "g" replaces the string "a" in the value of the tag or attribute of the input file with the string "aa" and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 g string-replace a aa - Rule "h" replaces the string "a" with the string "aa" in the memory variable "x".
Name Action Memory source Memory destination Input 1 Input 2 h string-replace x x a aa - Rule "i" replaces the string "a" with the string "aa" in the memory variable "x" and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 i string-replace x a aa - Rule "j" replaces string "a" in the value of a tag or attribute of the input file with string "aa" and writes it to the memory variable "x".
Name Action Memory source Memory destination Input 1 Input 2 j string-replace x a aa
- Rule "g" replaces the string "a" in the value of the tag or attribute of the input file with the string "aa" and writes it to the output xml file.
- "string-replace-regex" replace a string with another string using a regular expression. It is case sensitive. Usage:
- Rule "k" replaces a string in the value of a tag or attribute of an input file by placing the string "Forename Surname " in front of it and writing it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 k string-replace-regex ^(.*)$ Forename Surname $1 - Rule "l" replaces a string in the value of a tag or attribute of the input file by adding a space and the value of the memory variable "x" and writing it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 l string-replace-regex ^(.*)$ $1 ^^x$$ - Using memory variables is like "string-length" or "string-replace".
- Rule "k" replaces a string in the value of a tag or attribute of an input file by placing the string "Forename Surname " in front of it and writing it to the output xml file.
- "string-replace-regex-nocase" replacing a string with another string using a regular expression. It is not case sensitive. Usage is like "string-replace-regex".
- "string-translate" string translation. Usage:
- Rule "t1" translates the string into English and writes it to the output xml file. The input language is detected automatically.
Name Action Memory source Memory destination Input 1 Input 2 k string-translate en - Rule "t2" translates the string from German to English and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 k string-translate en de - Using memory variables is like "string-length" or "string-replace".
- Rule "t1" translates the string into English and writes it to the output xml file. The input language is detected automatically.
- "arithmetic-abs" find the absolute value of a number. Usage:
- Rule "l1" finds the absolute value of a tag or attribute of the input xml file and writes it to the output xml file. "Input 1" and "Input 2" are ignored.
Name Action Memory source Memory destination Input 1 Input 2 l1 arithmetic-abs - Using memory variables is like "string-length" or "string-replace".
- Rule "l1" finds the absolute value of a tag or attribute of the input xml file and writes it to the output xml file. "Input 1" and "Input 2" are ignored.
- "arithmetic-add" addition or subtraction (negative number addition). Usage:
- Rule "m" adds the number 100 to the value of the tag or attribute of the input file and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 m arithmetic-add 100 - The use of memory variables is the same as "string-length" or "string-replace".
- Rule "m" adds the number 100 to the value of the tag or attribute of the input file and writes it to the output xml file.
- "arithmetic-multiply" multiplication. Usage:
- Rule "n" multiplies the value of the tag or attribute of the input file by the number 10 and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 n arithmetic-multiply 10 - The use of memory variables is the same as "string-length" or "string-replace".
- Rule "n" multiplies the value of the tag or attribute of the input file by the number 10 and writes it to the output xml file.
- "arithmetic-divide" division. Usage:
- Rule "o" divides the value of the tag or attribute of the input file by the number 20 and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 o arithmetic-divide 20 - Using memory variables is like "string-length" or "string-replace".
- Rule "o" divides the value of the tag or attribute of the input file by the number 20 and writes it to the output xml file.
- "arithmetic-mod" finding the remainder after division. Usage:
- Rule "p" divides the value of the tag or attribute of the input file by the number 30, finds the remainder after division and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 p arithmetic-mod 30 - The use of memory variables is the same as "string-length" or "string-replace".
- Rule "p" divides the value of the tag or attribute of the input file by the number 30, finds the remainder after division and writes it to the output xml file.
- "arithmetic-round" natural rounding. Usage:
- Rule "r" rounds the value of a tag or attribute of the input file to 1 decimal place and writes it to the output xml file.
Name Action Memory source Memory destination Input 1 Input 2 r arithmetic-round 10 1 - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r" rounds the value of a tag or attribute of the input file to 1 decimal place and writes it to the output xml file.
- "arithmetic-round-up" rounding up. Usage: is like "arithmetic-round".
- "arithmetic-round-down" rounding down. Usage: is like "arithmetic-round".
- "logic-if-lt" conditional rule execution. Usage:
- Rule "r1" executes the rule "a" if the value of the tag or attribute of the input file is less than the number 30 (the number in the "Input 1" column). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r1 logic-if-lt 30 a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r1" executes the rule "a" if the value of the tag or attribute of the input file is less than the number 30 (the number in the "Input 1" column). Rule "a" must exist!
- "logic-if-le" conditional rule execution. Usage:
- Rule "r2" executes the rule "a" if the value of the tag or attribute of the input file is less than or equal to the number 40 (the number in the "Input 1" column). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r2 logic-if-le 40 a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r2" executes the rule "a" if the value of the tag or attribute of the input file is less than or equal to the number 40 (the number in the "Input 1" column). Rule "a" must exist!
- "logic-if-eq" conditional rule execution. Usage:
- Rule "r3" executes the rule "a" if the value of the tag or attribute of the input file is equal to "aaa" ("Input 1"). The type is not distinguished ("1" sa equals 1). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r3 logic-if-eq aaa a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r3" executes the rule "a" if the value of the tag or attribute of the input file is equal to "aaa" ("Input 1"). The type is not distinguished ("1" sa equals 1). Rule "a" must exist!
- "logic-if-eqq" conditional rule execution. Usage:
- Rule "r4" executes the rule "a" if the value of the tag or attribute of the input file is equal to "aaa" ("Input 1"). The type is distinguished ("1" is not equal to 1). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r4 logic-if-eqq aaa a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r4" executes the rule "a" if the value of the tag or attribute of the input file is equal to "aaa" ("Input 1"). The type is distinguished ("1" is not equal to 1). Rule "a" must exist!
- "logic-if-neq" conditional rule execution. Usage:
- Rule "r5" executes the rule "a" if the value of the tag or attribute of the input file is not equal to "aaa" ("Input 1"). The type is not distinguished ("1" equals 1). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r5 logic-if-neq aaa a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r5" executes the rule "a" if the value of the tag or attribute of the input file is not equal to "aaa" ("Input 1"). The type is not distinguished ("1" equals 1). Rule "a" must exist!
- "logic-if-neqq" conditional rule execution. Usage:
- Rule "r6" executes the rule "a" if the value of the tag or attribute of the input file is not equal to "aaa" ("Input 1"). The type is distinguished ("1" is not equal to 1). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r6 logic-if-neqq aaa a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r6" executes the rule "a" if the value of the tag or attribute of the input file is not equal to "aaa" ("Input 1"). The type is distinguished ("1" is not equal to 1). Rule "a" must exist!
- "logic-if-gt" conditional rule execution. Usage:
- Rule "r7" executes the rule "a" if the value of the tag or attribute of the input file is greater than the number 60 (the number in the "Input 1" column). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r7 logic-if-gt 60 a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r7" executes the rule "a" if the value of the tag or attribute of the input file is greater than the number 60 (the number in the "Input 1" column). Rule "a" must exist!
- "logic-if-ge" conditional rule execution. Usage:
- Rule "r8" executes the rule "a" if the value of the tag or attribute of the input file is greater than or equal to the number 70 (the number in the "Input 1" column). Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 r8 logic-if-ge 70 a - Using memory variables is the same as "string-length" or "string-replace".
- Rule "r8" executes the rule "a" if the value of the tag or attribute of the input file is greater than or equal to the number 70 (the number in the "Input 1" column). Rule "a" must exist!
- "logic-if" conditional rule execution. Usage:
- Rule "s" executes the rule "a" if the value of the tag or attribute of the input file is not empty. An empty value is an empty string or the number 0. Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 s logic-if a - Rule "t" executes rule "b" if the value of the tag or attribute of the input file is empty. An empty value is an empty string or the number 0. Rule "b" must exist!
Name Action Memory source Memory destination Input 1 Input 2 t logic-if b - Rule "u" executes the rule "a" if the value of the tag or attribute of the input file is not empty, rule "b" executes otherwise. An empty value is an empty string or the number 0. Rules "a" and "b" must exist!
Name Action Memory source Memory destination Input 1 Input 2 u logic-if a b - Rule "v" executes the rule "a" if the value of memory variable "x" is not empty. An empty value is a logical value of false, an empty string, or the number 0. Rule "a" must exist!
Name Action Memory source Memory destination Input 1 Input 2 v logic-if x a - Rule "y" executes rule "b" if the value of memory variable "x" is empty. An empty value is a logical value of false, an empty string, or the number 0. Rule "b" must exist!
Name Action Memory source Memory destination Input 1 Input 2 y logic-if x b - Rule "z" executes the rule "a" if the value of memory variable "x" is not empty, otherwise executes rule "b". An empty value is a logical value of false, an empty string, or the number 0. Rules "a" and "b" must exist!
Name Action Memory source Memory destination Input 1 Input 2 z logic-if x a b
- Rule "s" executes the rule "a" if the value of the tag or attribute of the input file is not empty. An empty value is an empty string or the number 0. Rule "a" must exist!
- "logic-if-not" conditional rule execution. The opposite condition is tested as in the case of "logic-if".
- "runtime-if-pass1" conditional rule execution. Allows you to execute a rule depending on the pass of processing of the input file.
It is only relevant when working with memory variables, the original input is the original at the beginning of each pass. It is possible to use it e.g. if a tag or attribute value that is retrieved later is required during processing. Usage:
- Rule "w" executes rule "a" if it is currently being processed in pass 1. Rule "a" must exist! The result is that the value of the tag or attribute is stored in the variable "x" in the 1st processing pass.
Name Action Memory source Memory destination Input 1 Input 2 a nop x w runtime-if-pass1 a - Similar to "logic-if" "Input 1" (if not empty) is executed if it is a pass 1 and a "Input 2" (if not empty) is executed if it is not a pass 1.
- Rule "w" executes rule "a" if it is currently being processed in pass 1. Rule "a" must exist! The result is that the value of the tag or attribute is stored in the variable "x" in the 1st processing pass.
- "runtime-if-pass1-not" conditional rule execution. The opposite condition is tested as in the case of "runtime-if-pass1".
- 2. New feed (xml file).
- It has a tree structure, that consists of tags and their attributes. The tag has a symbol ▼ at the beginning (if there are nested items) or without a symbol (if there are no nested items), the attribute is nested into the tag and at the beginning has the symbol A.
The structure is editable, it is possible to change the tag or attribute name. If the name is empty, the tag or attribute is skipped from processing (skipped). The order of tags or attributes can be changed with the mouse using "drag-and-drop" operations.
Clicking with the right mouse button displays the menu for further editing of the item:
- "Add rule" - from the subsequently opened menu it is possible to select from the defined rules.
- If it is a tag, "Insert attribute into" - the attribute will be added to the tag.
- If it is a tag, "Insert tag in" - a new tag will be inserted.
- If it is a created tag or attribute "Delete" - deletes the created tag or attribute.
- If the added rule is "Delete action xxx" - it removes the action of the tag or attribute.
- It has a tree structure, that consists of tags and their attributes. The tag has a symbol ▼ at the beginning (if there are nested items) or without a symbol (if there are no nested items), the attribute is nested into the tag and at the beginning has the symbol A.
The structure is editable, it is possible to change the tag or attribute name. If the name is empty, the tag or attribute is skipped from processing (skipped). The order of tags or attributes can be changed with the mouse using "drag-and-drop" operations.
Clicking with the right mouse button displays the menu for further editing of the item:
- 3. Action Buttons:
- "Save" saves all changes.
- "Test" will open the created output xml file (feed) in a new window. The action of the button is independent of saving changes!
- "Delete" deletes the current project. The project can also be deleted by clicking on the trash icon.