posted 23 years ago
Let's try and pin this down a bit.
SAX is the "Simple API for XML". Sax is a Java API for stream-based parsing of XML input. Most available Java XML parsers implement one or more versions of the SAX API.
Programs which use SAX are "callback"-based. A program uses the SAX API to register interest in specific tags and/or content, then invokes the parser. The parser runs through the XML stream from start to finish and calls your code whenever information in which you are interested is encountered. It is up to your program to build internal data structures, generate output or whatever else is needed - a SAX parser just lets you know that some data is there.
DOM is the "Document Object Model". DOM is a (largely) language independent model for how an XML doceument can be represented in memory. DOM is defined in terms of a set of operations which may be performed on a document. The precise details of how these operations are performed, and how the document data is actually stored in memory are up to the implementer of the parser and depend to some degree on the language chosen to implement the parser and the API.
DOM was designed by a commitee to be language independent, so it has to provide operations which can be implemented in a variety of languages. This means that using the DOM API can sometimes seem clumsy and unusual in any particular language. A lot of Java DOM parsers are actually implemented using SAX. The DOM parser uses the SAX API to register interest in all elements and content, then as the incoming data stream is parsed by the SAX-parser, the DOM parser catches the tags and content and builds the DOM data structures in memory.
A program which uses the DOM API typically "gulps" a whole XML file or stream into a DOM "Document" object, then traverses it looking for particular elements, attributes or content and performing operations on them or with them.
JDOM is a "Java Document Object Model". Designed to make using XML documents simpler for Java programmers, it performs a similar job to DOM, but in a java-specific way. If you want to write your own Java programs to manipulate XML documents, using JDOM is often a lot easier than using the language-neutral DOM API.
There are lots of parser implementations available, including Xerces, xml4j and so on. Many have no particular names, and are just built-in to other products such as the Resin web server. Sometimes a developer will not be sure which parser to choose and want to try several before deciding, which is where JAXP comes in.
JAXP is the "Java API for XML Parsing" from Sun. It provides a way to write programs which are independent of any particular parser implementation, and abstracts operations like starting a parser, telling it what to parse, and shutting it down when you have finished into a consistent API. JAXP is not a parser. Sun do provide an implementation of a SAX and DOM parser, which is often downloaded and installed with JAXP, but JAXP is really just a way to avoid rewriting your program every time you want to check out a new parser.
XSLT is a stylesheet specification language which allows you to write an XML definition of a transformation of an XML document into some other format. XSLT tools are often used to apply a particular look-and-feel to a simple XML document to make a complex HTML page for display on a web site, but XSLT is also capable of far more powerful transformations. To perform an XSLT transformation you need an XSLT processor. Some recent browsers have XSLT processors built-in, but the vast majority of XSLT processing is done on servers.
XSLT is its own language, so there is not really an XSLT API in the same way as there is for DOM and SAX. The only operations needed are usually starting the XSLT processor, telling it which stylesheet to use, and processing one or more documents. At present there is no equivalent to JAXP for XSLT processors, so if you want to directly use XSLT in this way you will most likely tie your code to a particular vendor's XSLT processor implementation.
As for databases. XML is essentially just a data interchange format, which happens to have some increasingly standardized tools available for it. It has no more to to do with databases than any other aspect of programming.