You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jonathan Carlson <jo...@yahoo.com> on 2002/03/04 22:24:45 UTC

null checking

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.

Thanks!

-- 
Jonathan Carlson
joncrlsn@users.sf.net
Minneapolis, Minnesota 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: null checking

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 3/4/02 4:24 PM, "Jonathan Carlson" <jo...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>