commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Perez Jorge <>
Subject Re: [JXPath] Testing for null values.
Date Thu, 22 Jan 2004 12:05:32 GMT
Hi again,

  Well, "boolean(propertyName/node())" seems to work; It will return 
Boolean.TRUE if the path exists and it's not null, and will return 
Boolean.FALSE if the path doesn't exist (lenient mode on) or the 
property is null.

   I need to do check that before this is evaluated:

   "aBeanPath/booleanProperty = false()"

   because if the path exists but booleanProperty is null, that 
expression will be evaluated to true().

  BTW if lenient mode is on and the path doesn't exist, both 
"aBeanPath/booleanProperty = false()" and "aBeanPath/booleanProperty = 
true()" will return false().  Shouldn't be this the right result when 
the path exists but the property is null?

  Thanks in advance.

Adrian P.J.

Adrian Perez Jorge wrote:

> Hi all!
>  What is the right way to test in a XPath expression if a bean 
> property is null?
>  "propertyName = false()" doesn't work because the property could be a 
> Boolean.
> Thanks in advance,
> Adrian P.J.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message