Returns a string from a string model. The text will be returned in the user's language.

Namespace

xmlns:AS="http://schema.advantages.cz/AsapFunctions"

Syntax

string GetString(string name)
string GetString(string name, arg0 ... arg9)

Parameters

Name

Description

name

Name of the string.

arg0An (optional) argument to be formatted into the string, replacing {0}.
arg1An (optional) argument to be formatted into the string, replacing {1}.
... arg9There can be up to 10 arguments passed to this function.

Remarks

This function is part of the localization infrastructure.

Example

This example produces a localized error message to the user.

The string is defined as:

The number cannot be higher than 100. Number passed: {0}
<ROOT>
	<test percentage="120"/>
</ROOT>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:AS="http://schema.advantages.cz/AsapFunctions"
	xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="AS date">
	<xsl:include href="model://e1c65fcd-118d-4eb3-9c2f-aa27fec132ba"/>
	<xsl:template match="ROOT">
		<RuleExceptionDataCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
			<xsl:apply-templates select="test"/>
		</RuleExceptionDataCollection>
	</xsl:template>
	<xsl:template match="test">
		<xsl:if test="@number > 100">
			<xsl:call-template name="Exception">
				<xsl:with-param name="FieldName"><xsl:value-of select="'number'"/></xsl:with-param>
				<xsl:with-param name="EntityName"><xsl:value-of select="'test'"/></xsl:with-param>
				<xsl:with-param name="Message"><xsl:value-of select="AS:GetString('NumberExceededError', @percentage)"/></xsl:with-param>
				<xsl:with-param name="Severity"><xsl:value-of select="'High'"/></xsl:with-param>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>