![]() |
![]() | ![]() | ![]() | 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-ofTo: NULL Date: 1/17/2008 1:36:00 PM Martin, thanks for the suggestions. I finally figured out how to use xsl:choose, xsl:when, and xsl:otherwise to accomplish my task just about ten minutes before your posting. I wanted to try using XSLT 2.0 as you suggested, but I'm working in a corporate environment where it isn't being utilized. I also tried adding empty-cells:show to the table's style attribute, but it also appeared not to be supported here. Anyway, thanks again for your suggestions. Allen Anderson -- Things are more like they are now than they ever have been before. "Martin Honnen" wrote: > 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 | |||||
|
