Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
The SAX specification defines an event-based approach whereby
parsers scan through XML data,
calling handler
functions whenever certain parts of the document (e.g., text nodes
or processing
instructions) are found.
These events
include the start and end of the document, finding a
text node, finding child elements,
and hitting a
malformed element. So the SAX parser doesn't create any
internal representation of the
document. Instead, the
parser calls handler functions when certain events
defined by the SAX specification) take place.
Here is the Example of Java Sax Parser:
public class Test extends DefaultHandler {
public static void main(String[] args) {
try {
Test saxNames = new Test();
SAXParser parser =
SAXParserFactory.newInstance().newSAXParser();
parser.parse(new
File("C://document.xml"),saxNames);
} catch (Exception e) {
e.printStackTrace(System.err);
}
}
public void startElement(String uri, String localName,
String qName,
Attributes attrs) {
}
public void endElement(String uri, String localName,
String qName) {
}
}
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.