xerces and JDOM

  • Thread starter Muni via JavaKB.com
  • Start date
L

Lasse Reichstein Nielsen

Muni via JavaKB.com said:
what is the diference between xerces , JDOM, SAX , and DOM

Xerces: An XML parser implementation from Apache. It implements
both a SAX parser and the W3C DOM. Exists in both Java
and C++.
<URL:http://xml.apache.org/#xerces>
JDOM: A Java-based solution for accessing, manipulating, and
outputting XML data from Java code. (Take from
<URL:http://www.jdom.org/>). It is based on other
libraries, including Xerces. It has its own Document
Object Model (DOM). It is both a specification and an
implementation.
<URL:http://www.jdom.org/>
SAX: Short for "Simple API for XML". It was really the first
general API for handling XML, with several implementations
existing.
It is fairly low-level, allowing you to handle each tag
in an XML file however you want.
<URL:http://www.saxproject.org/>
DOM: Short for Document Object Model, an object model of a
document (duh :). The object model describes a tree
structure of element and text nodes, matching the
tree structure of XML documents.
The most well known DOM is the W3C DOM, used both for
XML and HTML. JDOM has its own, similar but not identical,
DOM for XML documents.
<URL:http://www.w3.org/TR/DOM-Level-2-Core/>

Hope this helps. Read the links for much more information!
/L
 
C

Chris Smith

Lasse Reichstein Nielsen said:
JDOM: A Java-based solution for accessing, manipulating, and
outputting XML data from Java code. (Take from
<URL:http://www.jdom.org/>). It is based on other
libraries, including Xerces. It has its own Document
Object Model (DOM). It is both a specification and an
implementation.

I think it's worth being clearer that JDOM does *not* provide an
implementation of DOM, which is a W3C recommendation. The use of DOM in
conjunction with JDOM is a tad confusing, and the JDOM project
unfortunately continues this confusion by referring to the W3C standard
as "another version of DOM". In normal language, JDOM provides an
object model of a document, but it does *not* provide a Document Object
Model. The difference is significant enough to exclude even the remote
possibility of compatibility... so however similar it looks, an inch is
a mile in standards compliance issues like this.

In general, JDOM is appropriate (and much easier than DOM) for internal-
only uses of XML parsing within Java applications, where the important
thing is accessing the actual information from the document. External
interfaces that incorporate XML should use the better-standardized DOM.
If the programmer on the other side wishes to use JDOM, then they can
build a JDOM Document from the DOM model on their side of the
communication.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top