Library for advanced bindings
- 1 Tags
- 2 Operators
- 3 Data access
- 4 Functionalities
- 4.1 Normalize space
- 4.2 If
- 4.3 Choose
- 4.4 Substring
- 4.5 Concat
- 5 Examples
For the sake of simplicity, this documentation uses the term "extended bindings" for this document function.
Extended bindings make it possible to influence the document structure via XSLT. Compared to the document function "Scripts", extended bindings are able to change not only the text content but also other attributes such as text color, size of applied style, etc. They offer many possibilities, however, they are challenging to implement and maintain and have a higher loading time than documents without extended bindings. Therefore, extended bindings should be used sparingly and if possible not at all.
Tags
General Tags
Tag | Funktion |
---|---|
| These tags enclose the entire extended binding in the Word document. |
| These tags enclose all templates. |
| These tags enclose a template. |
| These tags enclose a parameter. |
| These tags enclose a variable. |
| These tags enclose a variable which will be output. |
| These tags enclose a template call. |
| These tags enclose a parameter which is passed in the template call. |
| These tags enclose a paragraph. |
| These tags enclose a set of WordprocessingML components. |
| These tags enclose plain text. |
| These tags enclose an entire table. |
| These tags enclose a table row. |
| These tags enclose a table cell. |
This list is not exhaustive.
Â
Formatting container tags
Tag | Funktion | Link zu Attributen |
---|---|---|
| Within these tags the formatting for paragraphs is defined. | |
| Within these tags the formatting for runs is defined. | |
| Within these tags the formatting for entire tables is defined. | |
| Within these tags the formatting for table rows is defined. | |
| Within these tags the formatting for table cells is defined. | |
| Plain text has no property tags, text is defined in the run property tags. |
Operators
Operator | Funktion |
---|---|
| Addition |
| Subtraction |
| Multiplication |
| Division |
| Equal |
| Unequal |
| Less than |
| Greater than |
| Less or equal |
| Greater or equal |
| Logical OR |
| Logical AND |
| Modulus |
| is used to address a variable. |
| Double slash: specifies a path with "root" as starting point. |
| Single slash: specifies a path with the current position as starting point. |
| Period: addresses the current element. |
| Colon: addresses the parent element of the current element. |
| addresses attributes. |
| | character: is a logical and; you can logically connect several elements with each other. |
| is used for a negation. |
Data access
Extended bindings can be used to access and use data in the same way as scripts. The data is stored in a variable.
Example of a variable:
<xsl:variable name="[NAME DER VARIABLE]" select="[REFERNZIERTES OBJEKT]" />
Â
Example of accessing a text field in the Document Parameter:
<xsl:variable name="Subject" select="//Text[@id='DocParam.Subject']" />
The "DocParam" prefix is not mandatory. However, the OneOffixx conventions dictate that fields in the Document Parameter must be provided with this prefix.
Example of accessing a CheckBox in the Document Parameter:
<xsl:variable name="CheckBox" select="//CheckBox[@id='DocParam.CheckBox']" />
The "DocParam" prefix is not mandatory. However, the OneOffixx conventions dictate that fields in the Document Parameter must be provided with this prefix.
Example of accessing a ComboBox:
The "DocParam" prefix is not mandatory. However, the OneOffixx conventions dictate that fields in the Document Parameter must be provided with this prefix.
Example of accessing a script:
Unlike accessing the document parameter, the prefix 'CustomElements' is mandatory here.
Functionalities
Normalize space
The function "Normalize-Space()" cleans up variables, input fields, etc. That means, if there should be a space in a field by mistake, it will be considered as empty.
The above variable contains the content of the subject field from the document parameter, cleaned from redundant spaces..
If
The "If" function offers the possibility to make actions dependent on conditions.
The above template checks if the subject field in the Document Parameter is not empty. If it is, the value is output, otherwise nothing happens.
Choose
The function "Choose" is an extension of the function If
. It offers the additional possibility to make a statement if the condition does not apply. For this the tags When
and Otherwise
are used. What is between the When
tags will be executed if the condition is true. What is between the Otherwise
tags will be executed if the condition is not true.
The above template checks if the subject field in the Document Parameter is not empty. If it is, the value will be output. If the subject field is empty, the information text "Subject is empty" is output.
Substring
The function "Substring" is divided into two sub-functions; there are Substring-before and Substring-after. One passes to the template a string (text) and a character (character) at which the text is to be separated.
*The first template outputs everything that comes before the "@" in the email. The second template outputs everything after the "@".
IMPORTANT
The character used as the starting point – in this case "@" – is not included in the output.
Concat
The Concat function is the opposite of the Substring function: it concatenates strings.
The template above creates an email address from the first name and last name, a dot is placed between the first name and last name, and "@example.com" is added after the last name.
Examples
Recipient with shipping method
The shipping type and the recipient have different style information, moreover the shipping type is an optional input. If it is desired that the recipient moves up one line if the dispatch type is not filled in, this must be solved with an extended binding. The usual scripts cannot use different style information in one script.
Dynamic tables
Tables with static number of rows and columns but optional display of rows and columns are another example for the use of extended bindings. Whether a row or column is displayed can be defined in the document parameter using a CheckBox.
Â
PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland