Library for advanced bindings


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

Tag

Funktion

<w:sdtContent></w:sdtContent>

These tags enclose the entire extended binding in the Word document.

<xsl:stylesheet></xsl:stylesheet>

These tags enclose all templates.

<xsl:template></xsl:template>

These tags enclose a template.

<xsl:param></xsl:param>

These tags enclose a parameter.

<xsl:variable></xsl:variable>

These tags enclose a variable.

<xsl:value-of></xsl:value-of>

These tags enclose a variable which will be output.

<xsl:call-template></xsl:call-template>

These tags enclose a template call.

<xsl:with-param></xsl:with-param>

These tags enclose a parameter which is passed in the template call.

<w:p></w:p>

These tags enclose a paragraph.

<w:r></w:r>

These tags enclose a set of WordprocessingML components.

<w:t></w:t>

These tags enclose plain text.

<w:tbl></w:tbl>

These tags enclose an entire table.

<w:tr></w:tr>

These tags enclose a table row.

<w:tc></w:tc>

These tags enclose a table cell.

This list is not exhaustive.

 

Formatting container tags

Tag

Funktion

Link zu Attributen

Tag

Funktion

Link zu Attributen

<w:pPr></w:pPr>

Within these tags the formatting for paragraphs is defined.

Paragraph Properties

<w:rPr></w:rPr>

Within these tags the formatting for runs is defined.

Run Properties

<w:tblPr></w:tblPr>

Within these tags the formatting for entire tables is defined.

Table Properties

<w:trPr></w:trPr>

Within these tags the formatting for table rows is defined.

TableRow Properties

<w:tcPr></w:tcPr>

Within these tags the formatting for table cells is defined.

TableCell Properties

<w:t></w:t>

Plain text has no property tags, text is defined in the run property tags.

Text/Run Properties


Operators

Operator

Funktion

Operator

Funktion

+

Addition

-

Subtraction

*

Multiplication

div

Division

=

Equal

!=

Unequal

< / &lt;

Less than

> / &gt;

Greater than

<= / &gt;=

Less or equal

>= / &lt;=

Greater or equal

or

Logical OR

and

Logical AND

Mod

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.

not()

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.

Example of a recipient with and without shipping method

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.

Example of a table with dynamically displayed rows / columns

 

PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland