SAX is a "Simple API for XML" - an API is "Application Programmer Interface". SAX allows us to write programs that process XML documents a bit at a time. SAX programs may be more difficult to follow than DOM programs - but they will perform well with the large XML documents that leave DOM thrashing.
The NodeCounter class is an implementation of ContentHandler.
We override three methods, <?xml version="1.0" encoding="UTF-8" ?> <stock andrew="was here"> <item price="50" legend="Pr-Burger" BarCode="E1" /> <item price="15" legend="Crisp S+V" BarCode="E5" /> <item price="15" legend="Crisp C+O" BarCode="E6" /> <item price="50" legend="Flat Cola" BarCode="E7" /> </stock>
|
The parameter
|