You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Evyatar Kafkafi <Ev...@orsus.com> on 2002/06/20 13:59:31 UTC

and 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
 

Re: and different ?

Posted by Tobbi <to...@systinet.com>.
   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 ----- 
  From: Evyatar Kafkafi 
  To: xerces-j-user@xml.apache.org 
  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