Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > lost in XML

Reply
Thread Tools

lost in XML

 
 
gk
Guest
Posts: n/a
 
      11-27-2006
Hi,

I am getting confused in XML processing.

i have read SAX API ...its event driven

I have read DOM API ....its Tree structured.


I found two more ! ....JAXP and JDOM.

are these two (JAXP,JDOM) different API or these have been derived
from the SAX,DOM ?

If these are really different API , then i am worried about ,why there
is no standardization ? if every X,Y,Z people starts inventing their
own API , it would be a total chaos .......

may be , i am wrong , JAXP and JDOM could be an extenstion of SAX ,
DOM ......am i right ?


same problem would be for vendors also, they will be also confused to
implement which API ....is not it ?

For example, I know XERCES-J , it implements SAX and DOM both ......i
know JAXP is of SUN.

what i dont know, is whether JAXP has been derived from SAX-DOM or is
a complete different API ?

 
Reply With Quote
 
 
 
 
probing@gmail.com
Guest
Posts: n/a
 
      11-28-2006
As far as I know, DOM and SAX are two kinds of standar API for
programming with XML.
Meanwhile, JDOM and JAXP are one of the implementation for each of them
separately.

P.S. there is a another XML processing method, like KXML, which is a
"pull" parser which will require less system memory.

"gk 写道:
"
> Hi,
>
> I am getting confused in XML processing.
>
> i have read SAX API ...its event driven
>
> I have read DOM API ....its Tree structured.
>
>
> I found two more ! ....JAXP and JDOM.
>
> are these two (JAXP,JDOM) different API or these have been derived
> from the SAX,DOM ?
>
> If these are really different API , then i am worried about ,why there
> is no standardization ? if every X,Y,Z people starts inventing their
> own API , it would be a total chaos .......
>
> may be , i am wrong , JAXP and JDOM could be an extenstion of SAX ,
> DOM ......am i right ?
>
>
> same problem would be for vendors also, they will be also confused to
> implement which API ....is not it ?
>
> For example, I know XERCES-J , it implements SAX and DOM both ......i
> know JAXP is of SUN.
>
> what i dont know, is whether JAXP has been derived from SAX-DOM or is
> a complete different API ?


 
Reply With Quote
 
 
 
 
gk
Guest
Posts: n/a
 
      11-28-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> As far as I know, DOM and SAX are two kinds of standar API for
> programming with XML.
> Meanwhile, JDOM and JAXP are one of the implementation for each of them
> separately.



are you sure ? you said ..its implementation ......but JAXP = java API
for XML Processing.

is not it an just API ?

and when it says , ".....JAXP supports SAX and DOM..".........
.....what it means ? does it mean , that it has all the interfaces
whatever the SAX and DOM has ....and also some more extra it has
.................is this correct ?



>
> P.S. there is a another XML processing method, like KXML, which is a
> "pull" parser which will require less system memory.
>
> "gk 写道:
> "
> > Hi,
> >
> > I am getting confused in XML processing.
> >
> > i have read SAX API ...its event driven
> >
> > I have read DOM API ....its Tree structured.
> >
> >
> > I found two more ! ....JAXP and JDOM.
> >
> > are these two (JAXP,JDOM) different API or these have been derived
> > from the SAX,DOM ?
> >
> > If these are really different API , then i am worried about ,why there
> > is no standardization ? if every X,Y,Z people starts inventing their
> > own API , it would be a total chaos .......
> >
> > may be , i am wrong , JAXP and JDOM could be an extenstion of SAX ,
> > DOM ......am i right ?
> >
> >
> > same problem would be for vendors also, they will be also confused to
> > implement which API ....is not it ?
> >
> > For example, I know XERCES-J , it implements SAX and DOM both ......i
> > know JAXP is of SUN.
> >
> > what i dont know, is whether JAXP has been derived from SAX-DOM or is
> > a complete different API ?


 
Reply With Quote
 
rxreyn3@gmail.com
Guest
Posts: n/a
 
      11-28-2006
Holy crap; don't get all emotional. Is this an academic discussion, or
do you have a problem?

If it is for academic purposes, the previous poster was correct when he
referred to the standard vs. the implementation. SAX parsers are more
for streaming and consuming large pieces of XML data. Where as DOM is
for a small XML instance like the DOM API in Internet Explorer that
AJAX apps use. Xerces and Saxon were written by some of the authors of
the actual standards. And, since XML is so damn simple, who cares if
there are a bunch of different parsers, they all follow the standard.

However, there are many OO solutions out there like XMLBeans, Castor
and Hibernate that extract this stuff from us. So, I don't actually
mess with low-level XML, what are you doing that this is such a
concern?

Rayan


gk wrote:
> (E-Mail Removed) wrote:
> > As far as I know, DOM and SAX are two kinds of standar API for
> > programming with XML.
> > Meanwhile, JDOM and JAXP are one of the implementation for each of them
> > separately.

>
>
> are you sure ? you said ..its implementation ......but JAXP = java API
> for XML Processing.
>
> is not it an just API ?
>
> and when it says , ".....JAXP supports SAX and DOM..".........
> ....what it means ? does it mean , that it has all the interfaces
> whatever the SAX and DOM has ....and also some more extra it has
> ................is this correct ?
>
>
>
> >
> > P.S. there is a another XML processing method, like KXML, which is a
> > "pull" parser which will require less system memory.
> >
> > "gk 写道:
> > "
> > > Hi,
> > >
> > > I am getting confused in XML processing.
> > >
> > > i have read SAX API ...its event driven
> > >
> > > I have read DOM API ....its Tree structured.
> > >
> > >
> > > I found two more ! ....JAXP and JDOM.
> > >
> > > are these two (JAXP,JDOM) different API or these have been derived
> > > from the SAX,DOM ?
> > >
> > > If these are really different API , then i am worried about ,why there
> > > is no standardization ? if every X,Y,Z people starts inventing their
> > > own API , it would be a total chaos .......
> > >
> > > may be , i am wrong , JAXP and JDOM could be an extenstion of SAX ,
> > > DOM ......am i right ?
> > >
> > >
> > > same problem would be for vendors also, they will be also confused to
> > > implement which API ....is not it ?
> > >
> > > For example, I know XERCES-J , it implements SAX and DOM both ......i
> > > know JAXP is of SUN.
> > >
> > > what i dont know, is whether JAXP has been derived from SAX-DOM or is
> > > a complete different API ?


 
Reply With Quote
 
probing@gmail.com
Guest
Posts: n/a
 
      11-29-2006
Maybe my previews post is not accurate, "JAXP" is JSR5 and "jaxp" is
its implementation on java.net

"gk 写道:
"
> (E-Mail Removed) wrote:
> > As far as I know, DOM and SAX are two kinds of standar API for
> > programming with XML.
> > Meanwhile, JDOM and JAXP are one of the implementation for each of them
> > separately.

>
>
> are you sure ? you said ..its implementation ......but JAXP = java API
> for XML Processing.
>
> is not it an just API ?
>
> and when it says , ".....JAXP supports SAX and DOM..".........
> ....what it means ? does it mean , that it has all the interfaces
> whatever the SAX and DOM has ....and also some more extra it has
> ................is this correct ?
>
>
>
> >
> > P.S. there is a another XML processing method, like KXML, which is a
> > "pull" parser which will require less system memory.
> >
> > "gk 写道:
> > "
> > > Hi,
> > >
> > > I am getting confused in XML processing.
> > >
> > > i have read SAX API ...its event driven
> > >
> > > I have read DOM API ....its Tree structured.
> > >
> > >
> > > I found two more ! ....JAXP and JDOM.
> > >
> > > are these two (JAXP,JDOM) different API or these have been derived
> > > from the SAX,DOM ?
> > >
> > > If these are really different API , then i am worried about ,why there
> > > is no standardization ? if every X,Y,Z people starts inventing their
> > > own API , it would be a total chaos .......
> > >
> > > may be , i am wrong , JAXP and JDOM could be an extenstion of SAX ,
> > > DOM ......am i right ?
> > >
> > >
> > > same problem would be for vendors also, they will be also confused to
> > > implement which API ....is not it ?
> > >
> > > For example, I know XERCES-J , it implements SAX and DOM both ......i
> > > know JAXP is of SUN.
> > >
> > > what i dont know, is whether JAXP has been derived from SAX-DOM or is
> > > a complete different API ?


 
Reply With Quote
 
gk
Guest
Posts: n/a
 
      11-29-2006

(E-Mail Removed) wrote:
> Maybe my previews post is not accurate, "JAXP" is JSR5 and "jaxp" is
> its implementation on java.net
>
> "gk 写道:
> "
> > (E-Mail Removed) wrote:
> > > As far as I know, DOM and SAX are two kinds of standar API for
> > > programming with XML.
> > > Meanwhile, JDOM and JAXP are one of the implementation for each of them
> > > separately.

> >
> >
> > are you sure ? you said ..its implementation ......but JAXP = java API
> > for XML Processing.
> >
> > is not it an just API ?
> >
> > and when it says , ".....JAXP supports SAX and DOM..".........
> > ....what it means ? does it mean , that it has all the interfaces
> > whatever the SAX and DOM has ....and also some more extra it has
> > ................is this correct ?
> >
> >
> >
> > >
> > > P.S. there is a another XML processing method, like KXML, which is a
> > > "pull" parser which will require less system memory.
> > >
> > > "gk 写道:
> > > "
> > > > Hi,
> > > >
> > > > I am getting confused in XML processing.
> > > >
> > > > i have read SAX API ...its event driven
> > > >
> > > > I have read DOM API ....its Tree structured.
> > > >
> > > >
> > > > I found two more ! ....JAXP and JDOM.
> > > >
> > > > are these two (JAXP,JDOM) different API or these have been derived
> > > > from the SAX,DOM ?
> > > >
> > > > If these are really different API , then i am worried about ,why there
> > > > is no standardization ? if every X,Y,Z people starts inventing their
> > > > own API , it would be a total chaos .......
> > > >
> > > > may be , i am wrong , JAXP and JDOM could be an extenstion of SAX ,
> > > > DOM ......am i right ?
> > > >
> > > >
> > > > same problem would be for vendors also, they will be also confused to
> > > > implement which API ....is not it ?
> > > >
> > > > For example, I know XERCES-J , it implements SAX and DOM both .......i
> > > > know JAXP is of SUN.
> > > >
> > > > what i dont know, is whether JAXP has been derived from SAX-DOM or is
> > > > a complete different API ?




You guys are not understanding my question.
I am not asking what is DOM and what is SAX etc .

OK, let me restate my question ,

we have seen JAXP , SAX , DOM .....so many API ....right ? agreed ?

JAXP === developed by SUN .....this is an API ...not implementation
......agreed ?

SAX,DOM === developed by W3 guys ....this is also an API ....not
implementation......agreed ?


Now, the implementor is a vendor ...and its the APACHE ,.....APACHE
has a product called XERCES-J .......this product has lots of
classes , interfaces which follows those above API
specification..................agreed ?


see, when we write XML parsing , we see imports like below...

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;


these kind of imports you will find ...........well, fine......very
nice....see , we dont have any import from specific vendor (like
apache xerces-j) ...is not it ? one from JAXP api ( javax.xml and blah
blah) and other is from DOM spec ..........so, its basically
implementation independent ........so far so good.


the points which is not understandable is ,

Q1 ) why there is a mixture of JAXP and DOM imports !

Q2) does JAXP api is influenced by DOM , SAX api ? or this JAXP
has no relation with DOM , SAX api ?

Q3) can we parse XML only with JAXP ...without importing DOM,SAX api ?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
embedding xml in xml as non-xml :) Mark Van Orman XML 5 09-15-2004 05:57 AM
What XML technologies to learn first for "XML Processing" and "XML Mapping"? Bomb Diggy Java 0 07-28-2004 07:26 AM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments