Hi,
I'm not sure if it's right behaviour or not, but along the XML Schema spec such two types in XML are supposed to be different.
 
The thruth is that the only way to differ "empty" and "null" element is possible only using XML Schema and "xsi:nill" attributes. On this level many applications differ between these two types.
 
   Tobbi
----- Original Message -----
Sent: Thursday, June 20, 2002 2:16 PM
Subject: RE: <a/> and <a></a> different ?

My question is about the DOM - will the 2 DOM trees be the same?
According to your answer, they should be different.
 
As far as I can check, they are the same !
So after parsing the XML to DOM, I can't tell whether it was "a" having empty string, or 'a" with no content.
 
I need some way to know from DOM tree which of the 2 XMLs it was...
 
    Evyatar
-----Original Message-----
From: Tobbi [mailto:[EMAIL PROTECTED]
Sent: Thu, June 20, 2002 3:08 PM
To: [EMAIL PROTECTED]
Subject: Re: <a/> and <a></a> different ?

   Hi,
I suppose that you don't get the same result parsing via SAX or DOM.
 
The difference is that <a></a> means: element "a" having an empty string as the child (or whitespace, I'm not sure)
On the other side <a/> means: element "a" with NO content, i.e. in DOM this element shouldn't have any childs.
 
   Tobbi
----- Original Message -----
Sent: Thursday, June 20, 2002 1:59 PM
Subject: <a/> and <a></a> different ?

Hi all,
 
Suppose I have one XML like this: <s><a></a></s>
and a second XML like this: <s><a/></s>
 
When I parse with a DOMParser, will I get the same DOM tree for both XMLs?
When I parse with SAX Pasrer, will I get the same SAX events for both XMLs?
 
TIA
    Evyatar
 

Reply via email to