home contribute faq download

FunctX XSLT Functions

functx:reverse-string

Reverses the order of characters

Google
Webxsltfunctions.com

Description

The functx:reverse-string function reverses the order of characters in a string. It returns a zero-length string if the argument is the empty sequence.

Arguments and Return Type

NameTypeDescription
$arg xs:string? the string to reverse
return value xs:string

XSLT Function Declaration

See XQuery definition.
XSLT 2.0 Syntax:
<xsl:function name="functx:reverse-string" as="xs:string" 
              xmlns:functx="http://www.functx.com" >
  <xsl:param name="arg" as="xs:string?"/> 
 
  <xsl:sequence select=" 
   codepoints-to-string(reverse(string-to-codepoints($arg)))
 "/>
   
</xsl:function>

Examples

XSLT ExampleResults
functx:reverse-string('abc')
cba
functx:reverse-string('a')
a

See Also

fn:reverseReverses the order of a sequence

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Need XSLT Help?
D A T Y P I C
Training | Consulting | Development

XQuery by Priscilla WalmsleyGet the book!
XQuery by Priscilla Walmsley