saxon:new-text

Returns a new text node, with given content.

new-text($content as xs:string?) ➔ text()

Arguments

 

$content

xs:string?

The content of the new text node

Result

text()

Namespace

http://saxon.sf.net/

Notes on the Saxon implementation

Available since Saxon 10.

Details

This function constructs a new parentless text node.

The content of the text node (that is, the string value of the node) is formed by evaluating the second argument. If this is an empty sequence, the string value will be a zero-length string.

If the function is called twice with the same arguments, it is unpredictable whether it returns the same node or different nodes from the two invocations.

See also:

saxon:new-attribute()

saxon:new-document()

saxon:new-element()

saxon:new-comment()

saxon:new-processing-instruction()