简体   繁体   中英

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, eg 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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM