This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Testing for presence of node
- From: "Raghvesh Agarwal" <raghvesha at ggn dot aithent dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 21 Jun 2002 09:17:55 +0530
- Subject: Re: [xsl] Testing for presence of node
- References: <PEEOKEDDEBLLMOCJBGMDCEGGCFAA.jjk3@msstate.edu>
- Reply-to: xsl-list at lists dot mulberrytech dot com
hi,
you can simply test by mentioning the node name .
in your case try
<xsl:if test = "subcategory">
...
</xsl:if>
regards
Raghvesh Agarwal
Aithent Technologies Pvt. Ltd
Gurgaon
----- Original Message -----
From: "Joel Konkle-Parker" <jjk3@msstate.edu>
To: "TheList" <thelist@lists.evolt.org>
Sent: Friday, June 21, 2002 6:57 AM
Subject: [xsl] Testing for presence of node
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I have an XML file that contains the following structure:
>
> <category>
> <subcategory>
> <article>
> </article>
> </subcategory>
> </category>
>
> In my XSLT stylesheet, I need to be able to test if the <category>
> node I'm working with contains a <subcategory> node. What's the best
> way to test for the presence of this node without actually doing
> anything with it? I was thinking <xsl:if test="something">.
>
> - -joeljkp
>
> - ---------------------------------------
> http://www.ballsome.com
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
>
> iQA/AwUBPRKA7H880CLOJa2eEQJxpwCg6XhYuz/DsUThGatqbkDa99G85XAAoL8b
> GrkEiFZTOBoCy9EHV1HxOiTA
> =ASvZ
> -----END PGP SIGNATURE-----
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list