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 TypeName | Type | Description |
$arg |
xs:string? |
the string to split |
return value |
xs:string* |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:lines" as="xs:string*"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="xs:string?"/>
<xsl:sequence select="
tokenize($arg, '(\r\n?|\n\r?)')
"/>
</xsl:function>
|
Examples<xsl:variable name="in-xml" as="item()*"> | | <in-xml>a
value
on
many
lines</in-xml> |
| </xsl:variable> |
XPath Example | Results |
---|
functx:lines('a value') |
a value |
functx:lines($in-xml) |
('a',
'value',
'on',
'many',
'lines') |
See AlsoHistory |
Recommended Reading:
|