Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

parser

 
Ranch Hand
Posts: 33
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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



 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 33
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
arunseege paramashivappa
Ranch Hand
Posts: 33
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Rancher
Posts: 43016
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the JRE (and by extension, the JDK) does come with implementations of both those APIs. You don't need anything else.
 
arunseege paramashivappa
Ranch Hand
Posts: 33
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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 ?
 
Get me the mayor's office! I need to tell her about this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic