lost in XML

G

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 ?
 
P

probing

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 дµÀ£º
"
 
G

gk

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 ?
 
R

rxreyn3

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
 
P

probing

Maybe my previews post is not accurate, "JAXP" is JSR5 and "jaxp" is
its implementation on java.net

"gk дµÀ£º
"
 
G

gk

Maybe my previews post is not accurate, "JAXP" is JSR5 and "jaxp" is
its implementation on java.net

"gk дµÀ£º
"



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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top