Differences From Artifact [bf41f38598]:
- File src/OFXMLParser.m — part of check-in [568ec65e80] at 2013-06-14 22:59:15 on branch trunk — Clean up OFXMLParser a little. (user: js, size: 24436) [annotate] [blame] [check-ins using]
To Artifact [12e7c5b831]:
- File
src/OFXMLParser.m
— part of check-in
[457e0e82af]
at
2013-06-16 20:03:47
on branch trunk
— Split OFUnboundNamespaceException.
OFUnboundNamespaceException is now only used when the namespace is not
bound. If the prefix is not bound, OFUnboundPrefixException is used now. (user: js, size: 24490) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
28 29 30 31 32 33 34 | #import "OFXMLAttribute.h" #import "OFStream.h" #import "OFFile.h" #import "OFSystemInfo.h" #import "OFInitializationFailedException.h" #import "OFMalformedXMLException.h" | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #import "OFXMLAttribute.h" #import "OFStream.h" #import "OFFile.h" #import "OFSystemInfo.h" #import "OFInitializationFailedException.h" #import "OFMalformedXMLException.h" #import "OFUnboundPrefixException.h" #import "autorelease.h" #import "macros.h" typedef void (*state_function)(id, SEL); static SEL selectors[OF_XMLPARSER_NUM_STATES]; static state_function lookupTable[OF_XMLPARSER_NUM_STATES]; |
︙ | ︙ | |||
122 123 124 125 126 127 128 | if (attributePrefix == nil) return; attributeNS = namespace_for_prefix(attributePrefix, namespaces); if ((attributePrefix != nil && attributeNS == nil)) | | | > | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | if (attributePrefix == nil) return; attributeNS = namespace_for_prefix(attributePrefix, namespaces); if ((attributePrefix != nil && attributeNS == nil)) @throw [OFUnboundPrefixException exceptionWithClass: [self class] prefix: attributePrefix parser: self]; [attribute->_namespace release]; attribute->_namespace = [attributeNS retain]; } @implementation OFXMLParser + (void)initialize |
︙ | ︙ | |||
578 579 580 581 582 583 584 | if (_data[_i] == '>' || _data[_i] == '/') { OFString *namespace; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) | | | > | 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | if (_data[_i] == '>' || _data[_i] == '/') { OFString *namespace; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) @throw [OFUnboundPrefixException exceptionWithClass: [self class] prefix: _prefix parser: self]; if ([_delegate respondsToSelector: @selector(parser: didStartElement:prefix:namespace:attributes:)]) [_delegate parser: self didStartElement: _name prefix: _prefix namespace: namespace |
︙ | ︙ | |||
667 668 669 670 671 672 673 | [_previous removeLastObject]; [_buffer removeAllItems]; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) | | | > | 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 | [_previous removeLastObject]; [_buffer removeAllItems]; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) @throw [OFUnboundPrefixException exceptionWithClass: [self class] prefix: _prefix parser: self]; if ([_delegate respondsToSelector: @selector(parser:didEndElement:prefix:namespace:)]) [_delegate parser: self didEndElement: _name prefix: _prefix namespace: namespace]; |
︙ | ︙ | |||
719 720 721 722 723 724 725 | attributesObjects = [_attributes objects]; attributesCount = [_attributes count]; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) | | | > | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 | attributesObjects = [_attributes objects]; attributesCount = [_attributes count]; namespace = namespace_for_prefix(_prefix, _namespaces); if (_prefix != nil && namespace == nil) @throw [OFUnboundPrefixException exceptionWithClass: [self class] prefix: _prefix parser: self]; for (j = 0; j < attributesCount; j++) resolve_attribute_namespace(attributesObjects[j], _namespaces, self); pool = objc_autoreleasePoolPush(); |
︙ | ︙ |