Re: How to check for null vaues in an XML String using java

Elliotte Harold <[email protected]> Thu, 9 Dec 2004 05:00:54 -0500
Newsgroups gmane.comp.java.sun.xml.general
Message-ID <[email protected]>
praveen kumar wrote:
> Hi List,
>                I have to check for null values in XML String.
>
> ie
> for eg.
>          <Name>Ram</Name><MRN>123</MRN><*Address/*>
>
> Here the *Address node is having a null value.*
> **


There's no such thing as null values in XML. An empty element does not
have a null value. Rather it's value is the empty string. Perhaps you
could argue that an element that was simply not present had a null
value, but that's a stretch. A lot depends on exactly how your local
application defines the notion of "value" since it's not really
somethings that's in the core of XML, just something that gets layered
on afterwards.

--
Elliotte Rusty Harold  [email protected]
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim

-----------------------------------------------------
xml-interest: A list for discussing XML technologies in the Java Platform.
To post, mailto:[email protected]
Archives at: http://archives.java.sun.com/xml-interest.html
To unsubscribe, mailto:[email protected] the following message;
signoff xml-interest.