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

praveen kumar <[email protected]> Thu, 9 Dec 2004 04:54:42 -0800
Newsgroups gmane.comp.java.sun.xml.general
Message-ID <[email protected]>
--0-950439814-1102596882=:77055
Content-Type: text/plain; charset=us-ascii

Hi Elliott,
                 ok what ever u may call.
I meant an element having NO value.
I need to find the element having no value.

How to find it??

is there any builtin function??


Please help in this regard.

its bit urgent.

Regards
Praveen Kumar


Elliotte Harold <[email protected]> wrote:
praveen kumar wrote:
> Hi List,
> I have to check for null values in XML String.
>
> ie
> for eg.
> Ram123<*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.


---------------------------------
Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.

-----------------------------------------------------
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.
--0-950439814-1102596882=:77055
Content-Type: text/html; charset=us-ascii

<DIV>Hi Elliott,</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ok what ever u may call.</DIV>
<DIV>I meant an element having NO value.</DIV>
<DIV>I need to find the element having no value.</DIV>
<DIV>&nbsp;</DIV>
<DIV>How to find it??</DIV>
<DIV>&nbsp;</DIV>
<DIV>is there any builtin function??</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Please help in this regard.</DIV>
<DIV>&nbsp;</DIV>
<DIV>its bit urgent.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards</DIV>
<DIV>Praveen Kumar</DIV>
<DIV><BR><BR><B><I>Elliotte Harold &lt;[email protected]&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">praveen kumar wrote:<BR>&gt; Hi List,<BR>&gt; I have to check for null values in XML String.<BR>&gt;<BR>&gt; ie<BR>&gt; for eg.<BR>&gt; <NAME>Ram</NAME><MRN>123</MRN>&lt;*Address/*&gt;<BR>&gt;<BR>&gt; Here the *Address node is having a null value.*<BR>&gt; **<BR><BR><BR>There's no such thing as null values in XML. An empty element does not<BR>have a null value. Rather it's value is the empty string. Perhaps you<BR>could argue that an element that was simply not present had a null<BR>value, but that's a stretch. A lot depends on exactly how your local<BR>application defines the notion of "value" since it's not really<BR>somethings that's in the core of XML, just something that gets layered<BR>on afterwards.<BR><BR>--<BR>Elliotte Rusty Harold [email protected]<BR>XML in a Nutshell 3rd 
 Edition Just
 Published!<BR>http://www.cafeconleche.org/books/xian3/<BR>http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim<BR><BR>-----------------------------------------------------<BR>xml-interest: A list for discussing XML technologies in the Java Platform.<BR>To post, mailto:[email protected]<BR>Archives at: http://archives.java.sun.com/xml-interest.html<BR>To unsubscribe, mailto:[email protected] the following message;<BR>signoff xml-interest.<BR></BLOCKQUOTE><p>
                <hr size=1>Do you Yahoo!?<br>
Read only the mail you want - <a href="http://us.rd.yahoo.com/mail_us/taglines/spamguard/*http://promotions.yahoo.com/new_mail/static/protection.html">Yahoo! Mail SpamGuard</a>.
-----------------------------------------------------
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.
--0-950439814-1102596882=:77055--