I have an xml element that has an optional attribute of mode. However, when I transform my xml, the end application barfs if this supposedly optional parameter isnt present.
Whats the best way of modifying the xslt, so that if this attribute isnt present, a default is used.
I was thinking of using a seperate template and using With-params. However, if I use
Then when the mode attribute isnt present, I get '' passed in, and so what i was hoping would be a default isnt entered.
Am I best off testing the $mode parameter in my template, and if it is null, setting it to a value, or is there a more elegant way of handling this?
Cheers
K
Whats the best way of modifying the xslt, so that if this attribute isnt present, a default is used.
I was thinking of using a seperate template and using With-params. However, if I use
Code:
<xsl:with-param name="mode"><xsl:value-of select="@TextMode" /></xsl:with-param>
and
<xsl:param name="mode">Default</xsl:param>
Then when the mode attribute isnt present, I get '' passed in, and so what i was hoping would be a default isnt entered.
Am I best off testing the $mode parameter in my template, and if it is null, setting it to a value, or is there a more elegant way of handling this?
Cheers
K