Skip empty XML nodes v.2


/ Published in: XSLT
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.