64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
- (BOOL)xmlParser: (OFXMLParser*)parser
foundString: (OFString*)string
{
printf("STRING\n\"%s\"\n\n", [string cString]);
return YES;
}
@end
int
main()
{
const char *foo = "bar<foo:bar bar='b&az' qux=\"quux\">foo<bar"
"<qux >bar<baz name=''/>quxbar</xasd>";
size_t len = strlen(foo);
size_t i;
OFXMLParser *parser = [OFXMLParser xmlParser];
[parser setDelegate: [[ParserDelegate alloc] init]];
/* Simulate a stream where we only get chunks */
|
>
>
>
>
>
>
>
>
>
|
|
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
- (BOOL)xmlParser: (OFXMLParser*)parser
foundString: (OFString*)string
{
printf("STRING\n\"%s\"\n\n", [string cString]);
return YES;
}
- (OFString*)xmlParser: (OFXMLParser*)parser
foundUnknownEntityNamed: (OFString*)entity
{
if ([entity isEqual: @"foo"])
return @"foobar";
return nil;
}
@end
int
main()
{
const char *foo = "bar<foo:bar bar='b&az' qux=\"quux\">foo<bar"
"<qux >bar<baz name='' test='&foo;'/>quxbar</xasd>";
size_t len = strlen(foo);
size_t i;
OFXMLParser *parser = [OFXMLParser xmlParser];
[parser setDelegate: [[ParserDelegate alloc] init]];
/* Simulate a stream where we only get chunks */
|