This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: checking if child exists


Why not try something like that :
<xsl:if test="boolean(item)">
<!-- use your node -->
</xsl:if>
or :
<xsl:choose>
<xsl:when test="boolean(item)">
<!-- use your node -->
</xsl:when>
<xsl:otherwise>
<!-- something else -->
</xsl:otherwise>
</xsl:choose>

Hope this helps...
JB
----- Original Message -----
From: ".::romina::." <romina@spcom.com.ar>
To: <xsl-list@mulberrytech.com>
Sent: Saturday, June 24, 2000 3:27 PM
Subject: checking if child exists


> Hello...
> I wanted to know if there's a way with xslt (i'm sure there is) to check
if
> a child of a node exists. For eg.
>
> <somethingbig>
> <law>
> <parag n="1">yadda yadda yadda</parag>
> <parag n="2"><item nb="1">blah</item> <item nb="2">blaah</item></parag>
> <parag n="3">something else</parag>
> </law>
> </somethingbig>
>
> I need to check if there's the child node <item> and if it exists to show
> the value of it and if it doesnt exist... well to go on checking for
nodes.
>
> Thanks in advance
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]