Professional Documents
Culture Documents
Jaxp - Sax
Jaxp - Sax
1
Objectives
2
• Explain SAX
• Discuss JAXP
• Discuss the working of
– JAXP with SAX
SAX - Simple API for XML
3
SAX - Package
4
Method Description
void startDocument() It receives notification of the beginning of the
document
void endDocument() It receives notification of the end of the
document
void startElement(String uri,
String name, String qname, It receives the notification for the beginning of
an element
Attributes attr)
void endElement(String uri, It receives notification of the end of an
String name, String qname) element.
characters(char ch[ ], int
start, int length) It receives the notification for character data
Methods Description
void processingInstruction(
String target, string data) It receives notification of a processing instruction.
void It receives an object that locates the origin of SAX
setDocumentLocator( Locator document events. The Locator object can be used to get
information about the location of the event, such as the
locator)
line number and the column position
void It begins the scope of a prefix-URI Namespace
startPrefixMapping( String mapping.
This method will be invoked before the corresponding
prefix, String uri)
startElement event.
void
endPrefixMapping(String It ends the scope of a prefix-URI mapping and this
event occurs after the corresponding endElement event.
prefix)
void skippedEntity(String It receives notification of a skipped entity and this
name) method is invoked by the Parser for each entity that is
skipped.
XMLReader interface
9
EntityResolver
getEntityResolver() Return the current entity resolver.
Method Description