velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: null checking
Date Mon, 04 Mar 2002 21:38:42 GMT
On 3/4/02 4:24 PM, "Jonathan Carlson" <joncrlsn2@yahoo.com> wrote:

> I didn't see anything in the Velocity users guide about checking for
> nulls.  Maybe it's there and I just missed it, but if someone could help
> me out here I'd appreciate it.
> 
> I'm retrieving XML nodes using XPath in Geir's DVSL tool and want to
> verify that the node exists before using it.


In your case you have it easy.

#if( $myNode)

will work, because it can never be a FALSE valued Boolean...  And will fail
if $myNode is null...  So no false positives...

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
The question is : What is a Mahnamahna?


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message