ng:spaceConcat

ng:spaceConcat

The built-in function, ng:spaceConcat(), helps concatenate two strings with a space character automatically inserted between them.

Here is an example:
This XPath expression:
ng:spaceConcat('First name:', 'Jon')
outputs this string:
First name: Jon
Notes
Important:
If you are concatenating values from an XML file and one of the values is a number, you must first convert the number to a string.
The ng:spaceConcat function works with string data types only.
Example:
ng:spaceConcat('Page:', string(ng:page-number()))
outputs this string:
Page: 2

An alternative method to concatenate two outputs (without automatically inserting a space) is to use the XPath function concat.
    • Related Articles

    • XPath

      In InterFormNG2, you use the language XPath for referencing data from the XML file. There are many sources of information if you want to learn more about XPath, but you can also simply read the few examples below to get a good idea of how it can be ...
    • Advanced XPath Features

      For more complex scenarios, XPath provides regular expressions, variable assignments, and special functions to manipulate and evaluate XML data dynamically. This section covers these advanced features. Working with regular expressions in XPath Using ...
    • String Manipulation

      XPath includes powerful functions for processing text within XML elements. This section explores how to concatenate strings, extract substrings, search within text, replace characters, and tokenize strings into lists. Adding preceding/leading or ...
    • XPath wizard

      When you in InterFormNG2 insert a value in a field, then you for most have these options: 1.You can insert a fixed text. 2.You can type a dynamic XPath expression where you need to remember each XPath function and the matching parameters. 3.For some ...
    • Node Existence & Conditions

      XPath allows you to verify the existence of nodes, check if they contain data, count occurrences, and ignore namespaces. This section covers essential techniques for validating and filtering XML elements. Calculating the sum of nodes Counting ...