BizTalk Utilities CV ,   Jobs ,   Code library  
 
The org.w3c.dom.ProcessingInstruction Interface
The org.xml.sax.XMLReader Interface
org.xml.sax.XMLFilter Interface
org.xml.sax.Locator Interface
org.xml.sax.HandlerBase Handler
org.xml.sax.ext.LexicalHandler Handler
org.xml.sax.ext.DeclHandler Handler
Overview of Content Handlers
Overview of DTD Handlers
java.xml.sax.InputSource Class
org.xml.sax.helpers.XMLReaderFactory Class
javax.xml.transform.URIResolver Class
javax.xml.transform.TransformerFactory Class
javax.xml.transform.Transformer Class
javax.xml.transform.Templates Class
javax.xml.transform.stream.StreamSource Class
javax.xml.transform.stream.StreamResult Class
javax.xml.transform.Source Class
javax.xml.transform.sax.SAXSource Class
javax.xml.transform.sax.SAXResult Class
<< XSLT
.NET and XML >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :10/13/2004
Times viewed :932

 

javax.xml Package Description

This reference provides explanations and descriptions for the javax.xml class packages.

Parsers

Provides classes allowing the processing of XML documents. Two types of plugable parsers are supported:

  • SAX (Simple API for XML)
  • DOM (Document Object Model)

One of the most important layers to any xml-aware application is the XML parser. This component handles the important task of taking a raw xml document as input and making sense of Document; it will make sure that xml document is well-formed, and if a DTD or Schema is referred, it may be ensure that document is valid.

What results from an XML document being parsed is typically a data structure that can be manipulated and handled by other xml tools or Java APIs. Selecting an xml parser is not an easy task. There are no hard and fast rules, but two main criteria are used. The first is the speed of the XML parser and second is the conformity to the xml specification. As the complexity of the xml document grows in terms of size, the speed of any xml parser in an important factor. Because performance is often more of a priority, some parsers may not conform to the finer points of the xml specification. User must need to decide the balance between these two factors depending upon the need of your application.

The Simple API for XML (SAX) APIs

To start the process, an instance of the SAXParserFactory class is used to generate an instance of the parser. The parser wraps a SAXReader object. When the parser's parse() method is invoked, the reader invokes one of several callback methods implemented in the application. Those methods are defined by the interfaces ContentHandler, ErrorHandler, DTDHandler, and EntityResolver.

The Document Object Model (DOM) APIs

You use the javax.xml.parsers.DocumentBuilderFactory class to get a DocumentBuilder instance, and use that to produce a Document (a DOM) that conforms to the DOM specification. The builder you get, in fact, is determined by the System property, javax.xml.parsers.DocumentBuilderFactory, which selects the factory implementation that is used to produce the builder. (The platform's default value can be overridden from the command line.)

You can also use the DocumentBuilder newDocument() method to create an empty Document that implements the org.w3c.dom.Document interface. Alternatively, you can use one of the builder's parse methods to create a Document from existing XML data. The result is a DOM tree like that shown in the diagram.

Resources

Here is the list of the most commonly used XML Parser. This list does not show whether the parser supports validation or not. No overall ranking is suggested here, but there is a wealth of information on the web pages of these parser.

All the code examples in this tutorial are based on Sun Microsystems Crimson and Apache’s Xerces parser. To know more about other parsers, please visit their website.


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C
Sr. Software Engineer

View all Jobs (Add yours)
View all CV (Add yours)



conference call
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses
help desk support


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP