ContentHandler « XML « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » XML » ContentHandler 
At this point, you should at least be comfortable with the mechanics of SAX and the ContentHandler interface. You've seen how events in a document parse are associated with specific callback methods in this handler, and how insertion of code in those callbacks is the means by which a SAX programmer interacts with XML data. However, understanding theory is hardly enough to write a useful program. To make this theory practical, this tip will demonstrate some realistic uses of SAX; I'll focus primarily on elements and textual data, as these are the most common use-cases of XML.

If you've been following along with this series of tips, you may be expecting to read about the SAX ErrorHandler interface -- that's what I promised at the end of the last tip, and that was certainly my intention. However, I've received several requests and suggestions for coverage of one last aspect of the ContentHandler interface, which of course I've been discussing for several tips now. Since the request was a good one, and involved another very common part of XML processing, I thought it was worth dealing with now. (For those of you who are just pining over error handling and the like, I hope you can hang on until my next tip!)

w___w_w___.___ja___v_a__2___s_.c___om__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.