Skip to content


April 18, 2008

Stream api for xml is pull based – control with application thread when to pull data. Read write both. Forward only. pull based api – is easy to use –

(Sax is push based so control is with the parser and also only read only api)

Feature Stax Sax Dom
Write XML Yes No Yes
CUD No No Yes
XPath Capability No No Yes
Forward Only Yes Yes No

For performance and memory use Cursor API (XMLStreamReader and XMLStreamWriter)

else use Iterator API: interface XMLEventReader extends Iterator ,interface XMLEventWriter…

General Stax classes : XMLInputFactory, XMLOutputFactory and XMLEventFactory

Comments are closed.

%d bloggers like this: