<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi folks.<br></div><div><br></div><div>Asking for advice.</div><div><br></div><div>I am now diving into learning and documenting Monty's SAX stuff.<br></div><div><br></div><div>I have never coded a SAX (I played Tuba in band, though)<br></div><div><br></div><div>Should I focus on SAX or SAX2?<br></div><div><br></div><div>The XML-Parser SaxHandler has a massive class comment that I could start with...<br></div><div><br></div><div>However, it has a subclass SAX2Parser with an interesting comment:<br></div><div><br></div><div><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>This class is a parser with an API like SAX 2.0, with separate SAX2ContentHandler, SAX2LexicalHandler, and SAX2DeclarationHandler classes that are subclassed unlike SAX 1.0 where a single,  unified handler class is subclassed directly. Parsers can be created with #on: or other instance creation messages, and instances of the content, lexical, and declaration handlers can be injected before parsing with #contentHandler:, #lexicalHandler:, and #declarationHandler:, like this:<br></div><div>(SAX2Parser on: xmlStringOrStream)<br></div><div>contentHandler: MyContentHandlerClass new;<br></div><div>declarationHandler: MyDeclarationHandlerClass new;<br></div><div>lexicalHandler: MyLexicalHandlerClass new;<br></div><div>parseDocument.<br></div><div><br></div><div>Each handler can access the SAX2Parser object with #parser and set the parsing result returned by #parseDocument with #parsingResult:.<br></div><div><br></div><div>SAXHandler is not deprecated and can still be used if you prefer the SAX 1.0 style API.<br></div></blockquote><div><br></div></div><div>I am thinking I should start with SAX2 study.<br></div><div><br></div><div>Do? Don't? Run Away?<br></div><div><br></div><div>thanks for your time.<br></div><div><br></div><div>t</div></div><br></body></html>