parsing - running Sax parser -
am new using sax parser .can tell me how run .and required run (jdk )..can have sax parser can parse both android xml , normal xml
sax parsers implemented creating contenthandler
object implements callback functions correspond events happen while parsing xml document. example, startdocument
method called when parser begins parsing document, , startelement
called when discovers new tag; similarly, endelement
, enddocument
, , error
called when parser finds end of tag or document, or when invalid sequence discovered.
this example shows how use sax parser. key myhandler
class extends defaulthandler
class (which implements contenthandler
interface) , overrides empty implementations of each callback method.
think of way: java saxparser
class knows how parse xml documents when discovers things of interest relies on handler class know them. defaulthandler
class helper implementation can extend pay attention interesting things.
Comments
Post a Comment