︙ | | | ︙ | |
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
[delegate parser: self
foundCharacters: characters];
[pool release];
}
[cache removeNItems: [cache count]];
*last = *i + 1;
state = OF_XMLPARSER_TAG_OPENED;
}
/* Tag was just opened */
- (void)_parseTagOpenedWithBuffer: (const char*)buffer
|
|
|
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
[delegate parser: self
foundCharacters: characters];
[pool release];
}
[cache removeAllItems];
*last = *i + 1;
state = OF_XMLPARSER_TAG_OPENED;
}
/* Tag was just opened */
- (void)_parseTagOpenedWithBuffer: (const char*)buffer
|
︙ | | | ︙ | |
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
|
parser: self];
[delegate parser: self
foundProcessingInstructions: pi];
[pool release];
[cache removeNItems: [cache count]];
*last = *i + 1;
state = OF_XMLPARSER_OUTSIDE_TAG;
} else
level = 0;
}
|
|
|
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
|
parser: self];
[delegate parser: self
foundProcessingInstructions: pi];
[pool release];
[cache removeAllItems];
*last = *i + 1;
state = OF_XMLPARSER_OUTSIDE_TAG;
} else
level = 0;
}
|
︙ | | | ︙ | |
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
|
if (buffer[*i] != '/') {
pool = [[OFAutoreleasePool alloc] init];
[namespaces addObject: [OFMutableDictionary dictionary]];
[pool release];
}
[cache removeNItems: [cache count]];
*last = *i + 1;
}
/* Inside a close tag, no name yet */
- (void)_parseInCloseTagNameWithBuffer: (const char*)buffer
i: (size_t*)i
last: (size_t*)last
|
|
|
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
|
if (buffer[*i] != '/') {
pool = [[OFAutoreleasePool alloc] init];
[namespaces addObject: [OFMutableDictionary dictionary]];
[pool release];
}
[cache removeAllItems];
*last = *i + 1;
}
/* Inside a close tag, no name yet */
- (void)_parseInCloseTagNameWithBuffer: (const char*)buffer
i: (size_t*)i
last: (size_t*)last
|
︙ | | | ︙ | |
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
|
if (![[previous lastObject] isEqual: cacheString])
@throw [OFMalformedXMLException exceptionWithClass: isa
parser: self];
[previous removeLastObject];
[cache removeNItems: [cache count]];
ns = namespace_for_prefix(prefix, namespaces);
if (prefix != nil && ns == nil)
@throw [OFUnboundNamespaceException exceptionWithClass: isa
prefix: prefix];
[delegate parser: self
|
|
|
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
|
if (![[previous lastObject] isEqual: cacheString])
@throw [OFMalformedXMLException exceptionWithClass: isa
parser: self];
[previous removeLastObject];
[cache removeAllItems];
ns = namespace_for_prefix(prefix, namespaces);
if (prefix != nil && ns == nil)
@throw [OFUnboundNamespaceException exceptionWithClass: isa
prefix: prefix];
[delegate parser: self
|
︙ | | | ︙ | |
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
|
} else {
attributeName = [cacheString copy];
attributePrefix = nil;
}
[pool release];
[cache removeNItems: [cache count]];
*last = *i + 1;
state = OF_XMLPARSER_EXPECT_DELIM;
}
/* Expecting delimiter */
- (void)_parseExpectDelimiterWithBuffer: (const char*)buffer
|
|
|
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
|
} else {
attributeName = [cacheString copy];
attributePrefix = nil;
}
[pool release];
[cache removeAllItems];
*last = *i + 1;
state = OF_XMLPARSER_EXPECT_DELIM;
}
/* Expecting delimiter */
- (void)_parseExpectDelimiterWithBuffer: (const char*)buffer
|
︙ | | | ︙ | |
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
|
[attributes addObject:
[OFXMLAttribute attributeWithName: attributeName
namespace: attributePrefix
stringValue: attributeValue]];
[pool release];
[cache removeNItems: [cache count]];
[attributeName release];
[attributePrefix release];
attributeName = attributePrefix = nil;
*last = *i + 1;
state = OF_XMLPARSER_IN_TAG;
}
|
|
|
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
|
[attributes addObject:
[OFXMLAttribute attributeWithName: attributeName
namespace: attributePrefix
stringValue: attributeValue]];
[pool release];
[cache removeAllItems];
[attributeName release];
[attributePrefix release];
attributeName = attributePrefix = nil;
*last = *i + 1;
state = OF_XMLPARSER_IN_TAG;
}
|
︙ | | | ︙ | |
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
|
CDATA = transform_string(cache, 2, NO, nil);
[delegate parser: self
foundCDATA: CDATA];
[pool release];
[cache removeNItems: [cache count]];
*last = *i + 1;
state = OF_XMLPARSER_OUTSIDE_TAG;
}
/* Comment */
- (void)_parseInCommentOpeningWithBuffer: (const char*)buffer
|
|
|
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
|
CDATA = transform_string(cache, 2, NO, nil);
[delegate parser: self
foundCDATA: CDATA];
[pool release];
[cache removeAllItems];
*last = *i + 1;
state = OF_XMLPARSER_OUTSIDE_TAG;
}
/* Comment */
- (void)_parseInCommentOpeningWithBuffer: (const char*)buffer
|
︙ | | | ︙ | |
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
|
comment = transform_string(cache, 2, NO, nil);
[delegate parser: self
foundComment: comment];
[pool release];
[cache removeNItems: [cache count]];
*last = *i + 1;
state = OF_XMLPARSER_OUTSIDE_TAG;
}
/* In <!DOCTYPE ...> */
- (void)_parseInDoctypeWithBuffer: (const char*)buffer
|
|
|
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
|
comment = transform_string(cache, 2, NO, nil);
[delegate parser: self
foundComment: comment];
[pool release];
[cache removeAllItems];
*last = *i + 1;
state = OF_XMLPARSER_OUTSIDE_TAG;
}
/* In <!DOCTYPE ...> */
- (void)_parseInDoctypeWithBuffer: (const char*)buffer
|
︙ | | | ︙ | |