velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: null checking
Date Mon, 04 Mar 2002 21:38:42 GMT
On 3/4/02 4:24 PM, "Jonathan Carlson" <> 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.                           
System and Software Consulting
The question is : What is a Mahnamahna?

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message