![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Using xsl:if with xsl:value-of >Thread Next - Re: Using xsl:if with xsl:value-of Re: Using xsl:if with xsl:value-ofTo: NULL Date: 1/16/2008 3:29:00 PM
AlBruAn wrote:
> Thank you for suggesting a way of avoiding using CDATA and escaping the &.
> My question is still this: how can I go about using data in the cell if any
> is available or replacing it, as you've suggested, with the   to ensure
> the border is drawn around the cell? As I mentioned in my original post, I
> thought there might be a way of incorporating xsl:if along with xsl:value-of,
> but I honestly don't know.
Use xsl:choose e.g. replace
<td><xsl:value-of select="ClaimNumber" /></td>
with
<td>
<xsl:choose>
<xsl:when test="normalize-space(ClaimNumber)">
<xsl:value-of select="ClaimNumber"/>
<xsl:when>
<xsl:otherwise> </xsl:otherwise>
</xsl:choose>
</td>
If you are using XSLT 2.0 then it is even easier
<td><xsl:value-of select="if (normalize-space(ClaimNumber)) then
ClaimNumber else ' '"/></td>
You should also investigate CSS 2 and the setting empty-cells: show. If
your browser supports that (and Mozilla, Opera do) then you can avoid
the above attempts and simply use CSS to ensure that empty cells are
shown: <URL:http://www.w3.org/TR/CSS21/tables.html#empty-cells>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
