If Then Statements in XSL
I have a question about if then statements in XSLT. I would like to display a line of code only if a specific data item is not null. It seems to be a bit of a daunting task for me, an XML/XSL n00b, but I'm hoping that some of the experts here will know just the trick.
Explanation below:
I curently have links setup like the following:
<a href="/express/index.cgi?add_by_express={$prod},{$unit},1">Read More</a><br/>
Where unit is defined as:
<xsl:variable name="unit">
<xsl:value-of select="Selling_UM_1"/>
</xsl:variable>
However, there are multiple instances where the value of Selling_UM_1 is empty in the XML. In these instances, I would like the link to not show, The link should only show up when Selling_UM_1 is populated. So I'm thinking something like:
If Selling_UM_1 != null {
Display <a href="/express/index.cgi?add_by_express={$prod},{$unit},1"> Read More</a><br/>
}
Else {
Display
}
I just don't know how to turn that into XSL.
Could anyone offer some suggestions?
Thanks
|