RE: [xsl] how check if the node exit and display content of it

Subject: RE: [xsl] how check if the node exit and display content of it
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Fri, 18 Mar 2005 02:56:50 +0000
Henry, if all you want to do is test for any children, just look along the child:: axis, like so:

   <xsl:template match="Group">
       <xsl:choose>
       <xsl:when test="child::*">
           has children
       </xsl:when>
       <xsl:otherwise>
           no children
       </xsl:otherwise>
       </xsl:choose>
   </xsl:template>

Regards,

--A


From: henry human <henry_human@xxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] how check if the node exit and display content of it Date: Thu, 17 Mar 2005 23:52:09 +0100 (CET)



i create xml files . the node "Group" could has child: <Group> <undergroups> <Duration>1:9</Duration> <description>Waiting for data</description> </undergroups> </Group> or could be without child: <Group> </Group> How could i check in my xsl file if this node has some child (f.example <Duration> or <description>) after that i will to display the Result(f.example Waiting for data) in browser i tied it with xsl:if test and xsl:variable but could'nt use it correctly!

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement


Current Thread