saxon:new-comment

Returns a new comment node, with given content.

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

Arguments

 

$content

xs:string?

The content of the new comment node

Result

text()

Namespace

http://saxon.sf.net/

Notes on the Saxon implementation

Available since Saxon 10.

Details

This function constructs a new parentless comment node.

The content of the comment (that is, the string value of the node) is formed by evaluating the first 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.

If the content contains the substring "--", or if it ends in "-", this is handled in the same way as the xsl:comment instruction; the value is fixed by inserting spaces.

See also:

saxon:new-attribute()

saxon:new-document()

saxon:new-element()

saxon:new-processing-instruction()

saxon:new-text()