Documentation

ETXMLParser class documentation

ETXMLParser : NSObject

AuthorsGenerated by qmathe
Declared inETXMLParser.h

Overview

An XML stream parse class. This parser is statefull, and will cache any unparsed data. Messages are fired off to the delegate for start and end tags as well as character data.

This class might more accurately be called ETXMLScanner or ETXMLTokeniser since the actual parsing is handled by the delegate.


Default

+ (id) parserWithContentHandler: (id< ETXMLWriting>)_contentHandler

Create a new parser with the specified delegate.

    - (id) initWithContentHandler: (id< ETXMLWriting>)_contentHandler

    Initialise a new parser with the specified delegate.

      - (id) pushContentHandler: (id< ETXMLWriting>)aContentHandler

      Set the class to receive messages from input data. Commonly used to delegate handling child elements to other classes.

        - (void) popContentHandler

        Pops the top content handler from the stack and returns control to the one below. Typically used when a handler has parsed a closing tag.

          - (id) parentHandler

          Returns the content handler above the current one.

            - (BOOL) parseFromSource: (NSString *)data

            Parse the given input string. This, appended to any data previously supplied using this method, must form a (partial) XML document. This function returns NO if an error occurs while parsing.

              - (void) setMode: (enum MarkupLanguage)aMode

              Switch between parsing modes. Acceptable values are PARSER_MODE_XML and PARSER_MODE_SGML. When in SGML mode, open tags do not have to have corresponding closing tags, allowing things like <br> to exist. XML is the default.