Posted By

AlexLocust on 03/01/10


Tagged

xslt xml empty XSL skip


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

gelogenic
Tyster


Skip empty XML nodes v.2


 / Published in: XSLT
 

  1. <xsl:template name="getValue">
  2. <xsl:param name="tagId"></xsl:param>
  3. <xsl:choose>
  4. <xsl:when test="normalize-space(//item[@id=$tagId]) != ''">
  5. <xsl:value-of select="string(//item[@id=$tagId])"/>
  6. </xsl:when>
  7. <xsl:otherwise>
  8. Tag is empty
  9. </xsl:otherwise>
  10. </xsl:choose>
  11. </xsl:template>

Report this snippet  

You need to login to post a comment.