commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Plotnikov" <>
Subject Re: Evaluating null value in getValue?
Date Fri, 18 Jun 2004 01:31:55 GMT
You may want to use the built-in XPath function null() instead of simply

- Dmitri

----- Original Message ----- 
From: "Nassim Chalfouh" <>
To: <>
Sent: Tuesday, June 15, 2004 5:16 AM
Subject: Evaluating null value in getValue?

Hi all,
i have the following classes:
public class Holder {

private String name;

private Holder sub;

Holder() {

name = "aaa";

sub = null;


public String getName() {

return name;


public Holder getSub() {

return sub;



and the sample code:
Holder h = new Holder();

JXPathContext jc = JXPathContext.newContext(h);

System.out.println((String) jc.getValue("name"));




The results are:




false         <---------- I expected true!

i tried to change the


but the output is still 'FALSE'

how can i test a null value in getValue method?

Thanks a lot for your help

Best regards,


Nassim Chalfouh    |    Quality Assurance                     Direct
Line : +33 1 70 91 24 41

Delivering the Unified Insurance Front-End <>


This e-mail message is a private and confidential correspondence
intended only for use of the individual or entity
named above. If you are not the intended recipient, or the agent
responsible to deliver it to the intended recipient,
you are hereby notified that any dissemination, distribution or copying
of this communication is strictly prohibited.
If you have received this communication in error, please immediately
notify us by return e-mail by clicking on the
e-mail address shown at the bottom of this note or by  phone (+ 33 1 70
91 24 30), and delete it there after from
your system. Thank you.

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

View raw message