I've been working through some legacy code in XSLT in order to replace it with something in a more widely used language, and I've hit something about which I can't find a reference.
What's the difference between
<xsl:variable name="following_actions" as="node()*">
and
<xsl:variable name="following_actions" as="node()?">
I'm accustomed to seeing the asterisk version give me a list of records matching some condition specified in the body of the xsl:variable block, but I don't think I've seen the question-mark version before.
Directly relevant remedial references happily accepted. I believe I'm operating on XSLT 2.0, FWIW.
Like with regular expressions, ?, *, and + designate optionality and multiplicity:
node() means 1 node.node()? means 0 or 1 nodes.node()+ means 1 or more nodes.node()* means 0 or more nodes.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With