ISML Function - encodeValue()



Short Description

encodes characters for a target document type

Table of Contents

Product Version


Product To Version



1 Introduction

This function can be used to encode the result of an ISML expression. The value of an ISML expression is returned by encodeValue() as a properly encoded string. Non string values are converted to a string before encoding is performed. The convertion is the same like calling the function getValue(). For details about the possible encodings see Cookbook - Encoding.

2 Syntax

encodeValue( <value> )
encodeValue( <value>, <encoding> )

3 Example

The first example shows how to properly encode user entered values if the actual message is printed with encoding="off"

<istext key="welcomeMessage" parameter0="#encodeValue(Profile:FirstName)#" parameter1="#encodeValue(Profile:LastName)#" encoding="off"/>

The next example shows how to specify an encoding (see Cookbook - Encoding for more variants:

#encodeValue(Profile:FirstName, 'json')

4 Parameters

4.1 value

value = ISML Expression

Specify the ISML expression to be encoded. Usually, this will be just a template variable. If the expression result is not of type string then this value will be converted before encoding takes place. Conversion is done in the same way as getValue(value).

4.2 encoding

encoding = ISML Expression

Optional parameter.

If the parameter is not set or null the encoding matching the current template type is used. Otherwise the encoding must be string with encoding identifiers, like html, javascript. For more details on how to use encoding types supported by Intershop or add a custom encoding type see: Cookbook - Encoding.

Reference - ISML Functions


The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets