Overview
| Comment: | There is no need to return a BOOL in OFXMLParserDelegate. If you want to stop parsing, you just throw an exception. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
87a3e4fb0a9df23ed622b7f3f58af320 |
| User & Date: | js on 2009-08-26 14:13:07 |
| Other Links: | manifest | tags |
Context
|
2009-08-26
| ||
| 14:24 | Add default implementation for OFXMLParserDelegate. (check-in: 280071188d user: js tags: trunk) | |
| 14:13 |
There is no need to return a BOOL in OFXMLParserDelegate. If you want to stop parsing, you just throw an exception. (check-in: 87a3e4fb0a user: js tags: trunk) | |
|
2009-08-17
| ||
| 21:13 | Ensure in the headers that we got the required definitions. (check-in: 5903c87d36 user: js tags: trunk) | |
Changes
Modified src/OFXMLParser.h from [4198601055] to [75a237522a].
| ︙ | ︙ | |||
13 14 15 16 17 18 19 | #import "OFString.h" extern int _OFXMLParser_reference; @class OFXMLParser; @protocol OFXMLParserDelegate | | | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
#import "OFString.h"
extern int _OFXMLParser_reference;
@class OFXMLParser;
@protocol OFXMLParserDelegate
- (void)xmlParser: (OFXMLParser*)parser
didStartTagWithName: (OFString*)name
prefix: (OFString*)prefix
namespace: (OFString*)ns
attributes: (OFArray*)attrs;
- (void)xmlParser: (OFXMLParser*)parser
didEndTagWithName: (OFString*)name
prefix: (OFString*)prefix
namespace: (OFString*)ns;
- (void)xmlParser: (OFXMLParser*)parser
foundString: (OFString*)string;
- (OFString*)xmlParser: (OFXMLParser*)parser
foundUnknownEntityNamed: (OFString*)entity;
@end
@protocol OFXMLUnescapingDelegate
- (OFString*)foundUnknownEntityNamed: (OFString*)entitiy;
|
| ︙ | ︙ |
Modified tests/OFXMLParser/OFXMLParser.m from [b1e1d76dd2] to [afd9073f80].
| ︙ | ︙ | |||
16 17 18 19 20 21 22 | #import "OFXMLParser.h" @interface ParserDelegate: OFObject <OFXMLParserDelegate> @end @implementation ParserDelegate | | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#import "OFXMLParser.h"
@interface ParserDelegate: OFObject <OFXMLParserDelegate>
@end
@implementation ParserDelegate
- (void)xmlParser: (OFXMLParser*)parser
didStartTagWithName: (OFString*)name
prefix: (OFString*)prefix
namespace: (OFString*)ns
attributes: (OFArray*)attrs
{
OFXMLAttribute **attrs_data;
size_t i, attrs_count;
|
| ︙ | ︙ | |||
46 47 48 49 50 51 52 |
printf(" prefix=\"%s\"\n", [attr_prefix cString]);
if (attr_ns != nil)
printf(" ns=\"%s\"\n", [attr_ns cString]);
printf(" value=\"%s\"\n", [attr_value cString]);
}
puts("");
| | < | < | | < | < | < < | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
printf(" prefix=\"%s\"\n", [attr_prefix cString]);
if (attr_ns != nil)
printf(" ns=\"%s\"\n", [attr_ns cString]);
printf(" value=\"%s\"\n", [attr_value cString]);
}
puts("");
}
- (void)xmlParser: (OFXMLParser*)parser
didEndTagWithName: (OFString*)name
prefix: (OFString*)prefix
namespace: (OFString*)ns
{
printf("END\nname=\"%s\"\nprefix=\"%s\"\nns=\"%s\"\n\n",
[name cString], [prefix cString], [ns cString]);
}
- (void)xmlParser: (OFXMLParser*)parser
foundString: (OFString*)string
{
printf("STRING\n\"%s\"\n\n", [string cString]);
}
- (OFString*)xmlParser: (OFXMLParser*)parser
foundUnknownEntityNamed: (OFString*)entity
{
if ([entity isEqual: @"foo"])
return @"foobar";
|
| ︙ | ︙ |