Please enable JavaScript to view this site.

InterFormNG Manual 2020

Navigation: The Designer > Introduction to Xpath

Internal Xpath functions in InterFormNG

Scroll Prev Top Next More

InterFormNG can refer to a lot of Xpath functions, but apart from them there are also a few special Xpath functions, that are specific for InterFormNG:

 

ng:dateFormat

The ng:dateFormat Xpath function has this format:

ng:dateFormat(DATE,inputPattern,outputPattern,locale), where:

 

DATE is the input date.

InputPattern is the pattern for the DATE field.

OutputPattern is the pattern of the output date field.

Locale        is the locale to use for conversion (english is default).

 

Examples of use of the ng:dateFormat function:

Use this function to convert from almost any date format into an other date format. This is normally used if the format of dates in the input file does not have the format, that you want to output. Date conversion can also be setup as a date format in the text style as described on page .

 

ng:dateFormat('4-08-2015','dd-MM-yyyy') outputs 2015-08-04

ng:dateFormat('4-08-2015','dd-MM-yyyy','MM') outputs 08

ng:dateFormat('24-08-2015','dd-MM-yyyy','EEEE') outputs Sunday

ng:dateFormat('24-08-2015','dd-MM-yyyy','EEEE','da-DK') outputs søndag

 

Please notice, that ng:dateFormat follows the rules of the link to the date formats above, so you should look out for these details:

 

In the format you need to specify a capital ‘M’ for the month. (A small, ‘m’ is the minute of the hour, so you probably do NOT want that..).

 

‘E’ selects the day of the week.

 

The length of identical characters sets the ‘length type’ e.g.:

 ‘E’, ‘EE’ or ‘EEE’ means ‘Fri’,

 ‘EEEE’ means ‘Friday’.

 ‘M’ means the month without preceding ‘0'.

 ‘MM’ means the month with preceding ‘0' for months 1-9.

 ‘MMM’ means the short name of the month e.g. ‘Jan’

 ‘MMMM’ means the long name of the month e.g. ‘January’.  

 

 

ng:fileExist

The ng:fileExist Xpath function has this format:

ng:fileExist(path), where path contains the path to a file, that should be verified.

The function returns true, if the file exists and false, if the file does not exist.

 

The function can e.g. be used for verifying, if a file exists before you try to embed it in a PDF file.

 

Example:

ng:fileExist('c:\temp\testfile.txt')

 

ng:base64

The ng:base64 XPath function has this format:

ng:base64(string). The function converts the input string into base64.

Example: The function call: ng:base64('Hello World') returns the value: SGVsbG8gV29ybGQ=