Subject: Re: Finding if a node exists
From: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Tue, 12 Mar 2002 16:01:28 -0000
|
a processor intensive method would be
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="test" select="boolean(//a)"/>
</xsl:template>
</xsl:stylesheet>
where the node u are looking for is a, if a is present it would be true
the result is placed in a variable named test.
though this may be optimised if u tell us a little bit more of the situation
u want to achieve.
cheers, jim fuller
----- Original Message -----
From: "Robin Samways" <rsamways@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, March 12, 2002 3:54 PM
Subject: Finding if a node exists
> Hi all,
>
> How could I check an entire xml document for the existence of one
> particular node, before determining to do something with its contained
> information (if any)?
>
> Thanks..
> Robin..
>
> Robin Samways, Web Applications Developer
> Concept Interactive Inc.
> 405 Riverview Dr. Chatham, ON, N7M 5J5
> www.conceptinc.ca
> t | 519.436.0303 ext. 230
> f | 519.436.1738
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|