Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re:

From: Diego TERCERO <diego.tercero@--------.-->
To: NULL
Date: 12/3/2004 1:10:00 AM
Colin (615498) wrote:
> Within an <xsl:choose> i'd like to check for the value of a node being NULL. 
> I've tried this:
> 
> <xsl:choose>
>  <xsl:when test="CalcRows[.'']">
>   <xsl:attribute name="Text"><xsl:value-of select="Heading" 
> /></xsl:attribute>
>  </xsl:when>
>  <xsl:otherwise>
>   <xsl:attribute name="Text"><xsl:value-of select="CalcRows" /><xsl:value-of 
> select="Heading" /></xsl:attribute>
>  </xsl:otherwise>
> </xsl:choose>
> 
> The syntax on the second line is incorrect.  How can I check for 'CalcRows' 
> having no value or value of NULL?
> 
> Thanks,
> Colin. 
> 
> 
What do you want to test :
1. CalcRows existing in the current context node ?(ex: 
<foo><CalcRows/></foo>

2. CalcRows having some text value ?(ex: <CalcRows>some text</CalcRows>)
3. CalcRows having children ? (ex: <CalcRows><foo/></CalcRows>
4. CaclRows having children with text value ? (ex: <CalcRows><foo>some 
text</foo></CalcRows>

for 1 it would be :
<xsl:when test="CalcRows">

for 2 it would be :
<xsl:when test="CalcRows/text()">

for 3 :
<xsl:when test="count(CalcRows/*) &gt; 0">

for 4 :
<xsl:when test="CalcRows/*/text()">







transparent
Print
Mail
Like It
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