An event-based XML parser. More...
#import <OFXMLParser.h>
Public Member Functions | |
(id< OFXMLParserDelegate >) | - delegate |
(void) | - setDelegate: |
(void) | - parseBuffer:withSize: |
(void) | - parseString: |
(void) | - parseStream: |
(void) | - parseFile: |
(size_t) | - lineNumber |
(BOOL) | - finishedParsing |
Static Public Member Functions | |
(id) | + parser |
Protected Types | |
enum | { OF_XMLPARSER_OUTSIDE_TAG, OF_XMLPARSER_TAG_OPENED, OF_XMLPARSER_IN_PROCESSING_INSTRUCTIONS, OF_XMLPARSER_IN_TAG_NAME, OF_XMLPARSER_IN_CLOSE_TAG_NAME, OF_XMLPARSER_IN_TAG, OF_XMLPARSER_IN_ATTR_NAME, OF_XMLPARSER_EXPECT_DELIM, OF_XMLPARSER_IN_ATTR_VALUE, OF_XMLPARSER_EXPECT_CLOSE, OF_XMLPARSER_EXPECT_SPACE_OR_CLOSE, OF_XMLPARSER_IN_EXCLAMATIONMARK, OF_XMLPARSER_IN_CDATA_OPENING, OF_XMLPARSER_IN_CDATA_1, OF_XMLPARSER_IN_CDATA_2, OF_XMLPARSER_IN_COMMENT_OPENING, OF_XMLPARSER_IN_COMMENT_1, OF_XMLPARSER_IN_COMMENT_2, OF_XMLPARSER_IN_DOCTYPE, OF_XMLPARSER_NUM_STATES } |
Protected Attributes | |
id< OFXMLParserDelegate > | delegate |
enum OFXMLParser:: { ... } | state |
OFMutableString * | cache |
OFString * | name |
OFString * | prefix |
OFMutableArray * | namespaces |
OFMutableArray * | attrs |
OFString * | attrName |
OFString * | attrPrefix |
char | delim |
OFMutableArray * | previous |
size_t | level |
size_t | lineNumber |
BOOL | lastCarriageReturn |
BOOL | finishedParsing |
An event-based XML parser.
OFXMLParser is an event-based XML parser which calls the delegate's callbacks as soon asit finds something, thus suitable for streams as well.
- (id <OFXMLParserDelegate>) delegate |
- (BOOL) finishedParsing |
- (size_t) lineNumber |
- (void) parseBuffer: | (const char*) | buf | ||
withSize: | (size_t) | size | ||
Parses a buffer with the specified size.
buf | The buffer to parse | |
size | The size of the buffer |
- (void) parseFile: | (OFString*) | path |
Parses the specified file.
path | The path to the file to parse |
+ (id) parser |
- (void) parseStream: | (OFStream*) | stream |
Parses the specified stream.
stream | The stream to parse |
- (void) parseString: | (OFString*) | str |
Parses the specified string.
str | The string to parse |
- (void) setDelegate: | (id <OFXMLParserDelegate>) | delegate |
Sets the delegate the OFXMLParser should use.
delegate | The delegate to use |