![]() |
When to use SAX![]() ![]() ![]() ![]() ![]()
If the information stored in your XML documents is machine readable and generated data then SAX is the right API for giving your programs access to this information. Machine readable and generated data include things like:
Java object properties stored in XML format. queries that are formulated using some kind of text based query language (SOL, XQL, OQL). result sets that are generated based on queries (this might include data in relational database tables encoded into XML). So, machine generated data is information that you normally have to create data structures and classes in Java. A simple example is the address book, which contains information about persons, as shown in the diagram before. This address book XML file is not like a word processor document, rather it is a document that contains pure data, which has been encoded into text using XML. When your data is of this kind, you have to create your own data structures and classes in order to manage, manipulate and persist this data. SAX allows you to quickly create a handier class, which can create instances of your object models based on the data stored in your XML documents. An example is a SAX document handler that reads an XML document that contains my address book and creates an AddressBook class that can be used to access this information. The address book XML document contains person elements, which contain name and e mail elements. My AddressBook object model contains the following classes: AddressBook class, which is a container for Person objects Person class, which is a container for name and e mail String objects. So my "SAX address book document handier" is responsible for turning person elements into Person objects, and then storing them all in an AddressBook object. This document handler turns the name and email elements into String objects. The SAX document handler you write does element to object mapping. If your information is structured in a way that makes it easy to create this mapping, you should use the SAX API. On the other hand, if your data is much better represented as a tree then you should use DOM.
|
|
Domain NamesXML HTML to XML Why XML? XML Example Program XML Structure XML Declaration Physical Structure in XML XML Syntax Well Formed and Valid Document Document Type Definition Logical Structures
Notation and Notation Declarations Entity References Importing an External DTD Cascading Style Sheets (XML) Rendering XML with CSS An Example Using CSS CSS Style Rules
XSL XSL Transformation XSL Formatting XSL Style Rules Schemas Limitations of DTD Validity of an XML Document
An Example using XML Schema Namespaces Xlinks and Xpointers Terminology Xlinks Extended Link Xpointers DOM and SAX What is DOM? The Basic Structure of an XML DOM-based Module What is SAX? When to use DOMWhen to use SAX Accessing the Database Using XML Delivering XML with Data Retrieving Data from SQL Database Using Web Assistant Wizard Displaying Records from the XML_EX Database Server Dynamic Web Publishing with Dynabase Enhydra Java/XML Application Server XML Server Technologies Purpose and Goal of the XML/EDI Guidelines Definitions for XML/EDI The Electronic Enterprise Server Scope of XML/EDI The Five Technologies of XML/EDI Integrating XML with EDI Ignore and Include Keywords XML/EDI Components The Implementation Process Identifying Data Sets Developing DTDs Application Specific Extensions XML and JAVA XML Application Architecture Channel Definition Format Creation of Channels Creating Channels Using CDF Document Description of the Channel Scheduling Logos Precaching Web Crawling Keeping Track of UsersWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |