File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "parser" Watch "parser" New topic
Author

parser

arunseege paramashivappa
Greenhorn

Joined: Nov 02, 2010
Posts: 29

Hello everyone,

I'am little confused in understanding parsers.

is SAX and DOM are specifications and vendors will provide implementaions for it,(like a specification given by sun on "servlets" and vendors(weblogic,jboss etc) will provide implementaion.)

please help me on this..

Thanks-Arun




Thanks-Arun
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
What exactly is your question?

Parsers are part of the standard Java library and have been since Java 1.4. The basic API is JAXP - the java api for xml processing.

Bill
arunseege paramashivappa
Greenhorn

Joined: Nov 02, 2010
Posts: 29


On JAXP i came up with below understanding

JAXP is an XML framework by SUN that allows programmers to plug-in any W3C compliant XML parser using Java's system property files. It is not a parser by itself, but provides a level of abstraction by facilitating dynamic parser selection.

JDOM is another XML framework that integrates standard Java collection classes with any W3C compliant DOM parser allowing programmers to manipulate DOM objects as Java Collections. Very much like JAXP, JDOM sits between the application and the parser. Note that JDOM by itself is not an XML parser

Xerces is Apache's collection of software libraries for parsing, validating, serializing and manipulating XML. The library implements a number of standard APIs for XML parsing, including DOM, SAX and SAX2.


dom4j is an easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework and with full support for DOM, SAX and JAXP.


these are above lines which are putting me in confusion on JAXP.

On DOM and SAX ,from the above i understood that they are standard APIs.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
JAXP is more an API than a framework. It goes beyond parsing (leveraging the SAX and DOM APIs), it also defines APIs for XPath, XSLT, XML validation and streaming XML parsing, amongst others.

JDOM is not like JAXP, as it does not implement much of the above.

JDOM, dom4j and XOM are variants of the basic DOM model, providing more Java-like APIs than DOM itself.


Ping & DNS - my free Android networking tools app
arunseege paramashivappa
Greenhorn

Joined: Nov 02, 2010
Posts: 29



i came with the understanding that Parser API (SAX,DOM,STAX) are like JDBC api.

like if we user jdbc api in our application code we can migrate to any databases just by loading driver for the perticular database.


Please correct me if m wrong.

i want to start working on xml,:

i want to parse xml using sax api and dom api.

which parser is implementing both the api's.

one more question:

is jdk bundled with implementation for both sax api and dom api ?



Thanks-Arun

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
Yes, the JRE (and by extension, the JDK) does come with implementations of both those APIs. You don't need anything else.
arunseege paramashivappa
Greenhorn

Joined: Nov 02, 2010
Posts: 29



like APIs for DOM,SAX and STAX ,APIs for XPath, XSLT, XML validation are also implemented by Parser vendors i,e parsers like Saxon,Xalan ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: parser