SaxReader class

Sax Reader
SAX stands for Simple API for XML. A Sax Parser is an event driven parser. Unlike the XMLDocument and DOM Parser it doesn't built up the complete document tree. Therefore it is faster than XMLDocument but you cannot reference nodes like in DOM.

Usage
As explained above the SAX parser is event driven. So you have to handle these events. To so create a new class that extends the SaxContentHandler class. The SaxContentHandler provides methods for handling events, like start of document, start of element node, document end, etc.

class MySaxContentHandler extends SaxContentHandler {  protected boolean startElement(str _namespaceURI, str _localName, str _qName, SaxAttributes _attributes) {     boolean ret; ;     ret = super(_namespaceURI, _localName, _qName, _attributes); info(_localName); return ret; } }

Next create a new SaxReader Object and register your SaxContentHandler at the reader. The SaxReader provides two methods to start parsing: parse and parseUrl.

SaxReader reader = new SaxReader; reader.contentHandler(new MySaxContentHandler); reader.parseUrl("http://terraserver.microsoft.com/TerraService2.asmx?WSDL");



Dynamics AX 4
Since Dynamcis AX 4 supports .NET use the System.Xml.XmlReader class to parse XML documents.