File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Design pattern in SAX parser. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Design pattern in SAX parser." Watch "Design pattern in SAX parser." New topic

Design pattern in SAX parser.

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
what is the design pattern used in SAX parser.

SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
The Simple API for XML is not a parser, it is a programming API that is used in conjunction with a parser. It looks like you have a lot to learn, good luck!

Also, the first word in English sentences is always capitalized and questions are terminated with question marks '?' not period characters.
Vamsi Mohan
Ranch Hand

Joined: Jun 20, 2009
Posts: 80
DOM or SAX , JAXP uses factory design pattern.

(SCJP5.0, IBM Rational Solution Designer, IBM Rational Architect, IBM RUP Designer)
Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
I wanted to know for both SAX and DOM parser.
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
I don't know

BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
As James already pointed out, SAX is an API, not an implementation of the API.

Now - you could talk about a Design Pattern used in a particular implementation of the API, but that would depend on the programmer who created it.

Why dont you study - for example - the Java 6 source code for the various classes in the javax.xml.parsers package and decide for yourself which patterns are being used.


Stephan Ort

Joined: Jun 08, 2010
Posts: 5
you can look here:

I think they say SAX has to do with the observer pattern...
Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
Thanks Stephan. Also following link StAX Vs SAX talks about the patterns used by StAX and SAX
I agree. Here's the link:
subject: Design pattern in SAX parser.
It's not a secret anymore!