Description
The functx:lines function splits a string into individual lines, using the carriage return and newline characters to indicate the end of a line.
Arguments and Return Type| Name | Type | Description |
$arg |
xs:string? |
the string to split |
| return value |
xs:string* |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for July 2004 - January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:lines
( $arg as xs:string? ) as xs:string* {
tokenize($arg, '(\r\n?|\n\r?)')
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function lines
( $arg as xs:string? ) as xs:string* {
fn:tokenize($arg, '(\r\n?|\n\r?)')
} |
Exampleslet $in-xml := | <in-xml>a
value
on
many
lines</in-xml> | return |
| XQuery Example | Results |
|---|
functx:lines('a value')
|
a value
|
functx:lines($in-xml)
|
('a',
'value',
'on',
'many',
'lines')
|
See AlsoHistory |
|