Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Using xsl:if with xsl:value-of

From: albruan@-------.---.(---------)
To: 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/
> 


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent