TOC PREV NEXT INDEX

Wireless Data Server 3.0 Beta

Administrator's Guide

View in pdf format
Go to User's Guide



Wireless Data Server XSLT extension functions


This appendix details the functions that Wireless Data Server provides to extend the standard XSLT stylesheet language. To use these functions, you must specify Steltor's namespace by including the following line in the <xsl:stylesheet> tag at the beginning of your XSL document:

xmlns:wds="http://www.steltor.com/WDS/XSLT/Functions"

You may then access any of the functions described below by prefacing the function name with wds:. For example, you could use the locale-string() function to print a string from the localization files Wireless Data Server maintains for a given language using the following syntax in your XSL stylesheet:

<xsl:value-of select="wds:locale-string(...)"/>

These functions fall into three broad categories:

They are also listed alphabetically in the table below.
Table D.1 · Wireless Data Server XSLT extension functions
Function name Description Page
confirmation-symbol() Returns the configured symbols for accepted and declined meetings 104
date-to-sec() Returns a date as the number of seconds from a fixed point 108
encode-string() Converts a string value to a specified MIME encoding 105
extract-initials() Returns the initials for any specified name 106
format-date() Returns a formatted date when given date and time components 107
format-date-sec() Returns a formatted date when given a value in seconds 109
isolatin1-representation() Converts a string value to isolatin1 encoding 106
locale-service-string() Returns the localized string representing a Wireless Data Server mobile-originated command 103
locale-string() Returns a specified string from a Wireless Data Server locale file 102
string-replace-all() Replaces all occurrences of a given substring within a given string 105



Getting string values from localization files

locale-string()

The locale-string() function returns a specified string from a Wireless Data Server localization file.

Usage

locale-string(locale,category,key,default)

Arguments

locale

A string, enclosed in single quotes, that matches one of the languages listed in the value of the wdslocale.ini [WDS] locales parameter.

category

Can have either of two possible values:

key

A string, enclosed in single quotes, that matches any parameter in the file and section specified by the locale and category arguments. The locale-string() function returns the value of this parameter.

default

Optional. If no entry is found corresponding to the key, category and locale arguments, locale-string() will return this default value.

Example

locale-service-string()

The locale-service-string() function returns a specified Wireless Data Server mobile-originated command.

Usage

locale-service-string(locale,service,key,default)

Arguments

locale

A string, enclosed in single quotes, that matches one of the languages listed in the value of the wdslocale.ini [WDS] locales parameter. This value determines in which section of the file specified by the service argument the localized string can be found.

service

A string, enclosed in single quotes, that matches one of the services listed in the value of the wds.ini [WDS] services parameter. Wireless Data Server will look for the localized string in the file specified by the localefilename parameter in the section of wds.ini. specified by the service argument.

key

A string, enclosed in single quotes, that matches any parameter in the file and section specified by the service and locale arguments. The locale-string() function returns the value of this parameter.

default

Optional. May be any string enclosed in single quotes. If no entry is found corresponding to the key, service and locale arguments, locale-service-string() will return this default value.

Example

confirmation-symbol()

The confirmation-symbol() function returns a character indicating the recipient's attendance status.

Usage

confirmation-symbol(status)

Arguments

status

A string, enclosed in single quotes, that accepts the following values:

Example



String manipulation

encode-string()

The encode-string() function converts a specified string to a MIME encoding.

Usage

encode-string(encoding,str)

Arguments

encoding

A string, enclosed in single quotes, that determines the encoding to use for the specified string. Currently accepts only 'QUOTED-PRINTABLE'.

service

A string to encode, enclosed in single quotes.

Example

string-replace-all()

The string-replace-all() function replaces all occurrences of a given substring with another.

Usage

string-replace-all(str,from,to)

Arguments

str

A string, enclosed in single quotes, within which to replace a given substring.

from

A substring to replace, enclosed in single quotes.

to

A substring with which to replace the from substring, enclosed in single quotes.

Example

isolatin1-representation()

The isolatin1-representation() function converts each character in a given string to the isolatin1 representation of that character. This affects a variety of special characters that can be represented in the isolatin1 character set by unusual characters or multiple characters.

Usage

isolatin1-representation(encoding,str)

Arguments

encoding

A string, enclosed in single quotes, that determines the initial character set of the string. Currently accepts only 'UTF-8'.

service

A string to convert, enclosed in single quotes.

Example

extract-initials()

The extract-initials() function returns the initials of a given name.

Usage

extract-initials(firstname,lastname)

Arguments

firstname

A string, enclosed in single quotes, that specifies a given name.

lastname

A string, enclosed in single quotes, that specifies a surname.

Example



Date manipulation

format-date()

The format-date() function returns a given date in a specified output format.

Usage

format-date(year,month,day,hour,minute,second,format,locale)

Arguments

year

A four-digit number between 1991 and 2037 specifying the year.

month

A one- or two-digit number between 1 and 12 specifying the month.

day

A one- or two-digit number between 1 and 31 specifying the day of the month.

hour

A two-digit number between 00 and 23 specifying the hour of the day.

minute

A two-digit number between 00 and 59 specifying the minute of the hour.

second

A two-digit number between 00 and 59 specifying the second of the minute.

format

A string, enclosed in single quotes, specifying the format in which to display the given date. This format may include any of the following variables, as well as any desired separators and other text:

Any variables that produce text, such as %A, %B and %p will produce the text in the language specified by the locale argument.

locale

A string, enclosed in single quotes, that matches one of the languages listed in the value of the wdslocale.ini [WDS] locales parameter. Determines the language to be used for any variables included in the format argument that produce text.

Example

date-to-sec()

The date-to-sec() function returns a given date as the number of seconds since 1 January 1991 00:00:00. This function is most useful in combination with the format-date() function.

Usage

date-to-sec(year,month,day,hour,minute,second)

Arguments

year

A four-digit number between 1991 and 2037 specifying the year.

month

A one- or two-digit number between 1 and 12 specifying the month.

day

A one- or two-digit number between 1 and 31 specifying the day of the month.

hour

A two-digit number between 00 and 23 specifying the hour of the day.

minute

A two-digit number between 00 and 59 specifying the minute of the hour.

second

A two-digit number between 00 and 59 specifying the second of the minute.

Example

format-date-sec()

The format-date-sec() function returns a date in a specified output format, given the number of seconds since 1 January 1991 00:00:00. This utility is most useful in combination with the date-to-sec() function.

Usage

format-date-sec(seconds,format,locale)

Arguments

seconds

A number specifying the seconds between 1 January 1991 00:00:00 and the date to be formatted.

format

A string, enclosed in single quotes, specifying the format in which to display the given date. This format may include any of the following variables, as well as any desired separators and other text:

Any variables that produce text, such as %A, %B and %p will produce the text in the language specified by the locale argument.

locale

A string, enclosed in single quotes, that matches one of the languages listed in the value of the wdslocale.ini [WDS] locales parameter. Determines the language to be used for any variables included in the format argument that produce text.

Example


Steltor
http://www.steltor.com
Voice: (514) 733-8500
Fax: (514) 733-8878
info@steltor.com
TOC PREV NEXT INDEX
 
Copyright information