Blog Stats
  • Posts - 42
  • Articles - 0
  • Comments - 61
  • Trackbacks - 36

 

Check for nodename in XSLT

Its always necessary sometimes in XSLT processing that we check for things like whether a node exists to do certain operations. Checking for nodenames is the clue. This is how you do it.

<xsl:variable name="varname"> 
  <xsl:value-of select="ParentNode/*[name()='childnodename to check for']"/>         
<xsl:variable>
<xsl:if test="$varname=''"> Processing here...
<xsl:if>


Feedback

# re: Check for nodename in XSLT

Gravatar Thank you! 5/17/2005 9:51 PM | Michiel

# re: Check for nodename in XSLT

Gravatar Exactly what I was looking for & without trawling through the w3c reference - thanks! 3/1/2006 6:08 AM | Mhunt

Post a comment





 

 

 

Copyright © Vinayak