lost in XML

Discussion in 'Java' started by gk, Nov 27, 2006.

  1. gk

    gk Guest

    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 ?
     
    gk, Nov 27, 2006
    #1
    1. Advertising

  2. gk

    Guest

    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 ?
     
    , Nov 28, 2006
    #2
    1. Advertising

  3. gk

    gk Guest

    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 ?
     
    gk, Nov 28, 2006
    #3
  4. gk

    Guest

    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:
    > 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 ?
     
    , Nov 28, 2006
    #4
  5. gk

    Guest

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

    "gk дµÀ£º
    "
    > 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 ?
     
    , Nov 29, 2006
    #5
  6. gk

    gk Guest

    wrote:
    > Maybe my previews post is not accurate, "JAXP" is JSR5 and "jaxp" is
    > its implementation on java.net
    >
    > "gk дµÀ£º
    > "
    > > 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 ?
     
    gk, Nov 29, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bomb Diggy
    Replies:
    0
    Views:
    452
    Bomb Diggy
    Jul 28, 2004
  2. Tony Prichard
    Replies:
    0
    Views:
    745
    Tony Prichard
    Dec 12, 2003
  3. Mark Van Orman

    embedding xml in xml as non-xml :)

    Mark Van Orman, Sep 14, 2004, in forum: XML
    Replies:
    5
    Views:
    484
    Patrick TJ McPhee
    Sep 15, 2004
  4. badd
    Replies:
    2
    Views:
    253
  5. Erik Wasser
    Replies:
    5
    Views:
    468
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page