xs:normalizedString

Converts $string-var (a string) to the normalizedString data type. As part of the conversion, all occurrences of tabs (#x9), line feeds (#xA) and carriage returns (#xD) are replaced with spaces (#x20).

Signatures

xs:normalizedString(xs:string $string-var) —> xs:normalizedString

Arguments

Data Type
Argument
Description

xs:string

$string-var

Represents the string for conversion.

Returns

Returns $string-var after conversion to the normalizedString data type.

Examples

Remove Tabs

As part of the conversion to the normalizedString data type, tabs are replaced by spaces as shown in the following example query:

<result>{xf:normalizedString("	tab1	tab2	tab3	tab4")}</result> 

The preceding query, generates the following XML result:

<result> tab1 tab2 tab3 tab4</result> 

Remove Carriage Returns

As part of the conversion to the normalizedString data type, carriage returns are replaced by spaces as shown in the following example query:

<result>{xf:normalizedString("
CR1
CR2
")}</result> 

The preceding query, generates the following XML result:

<result> CR1 CR2 </result> 

Related Topics

W3C normalizedString data type description.