Search code examples
xsltxslt-2.0

How to give a variable the value "empty sequence"?


I would like to have a variable with the empty sequence as value. (For what it might be worth, it is mostly for debugging purposes, e.g. passing it as a parameter to my functions)

For the time being I am using something along the lines of

<xsl:variable name="empty_sequence" select="a_node_name_that_does_not_exist"/>

but it feels hackish and I would prefer something more readable anyway. What other options are there?


Solution

  • Use () to denote an empty sequence e.g. <xsl:variable name="empty-seq" select="()"/>.