Differences From Artifact [d295443a31]:
- File src/OFXMLElement.m — part of check-in [03f14bf019] at 2011-10-04 13:14:16 on branch trunk — Split OFXMLElement into OFXML{Element,Characters,CDATA,Comment}. (user: js, size: 24170) [annotate] [blame] [check-ins using]
To Artifact [7304a0b96d]:
- File
src/OFXMLElement.m
— part of check-in
[0a083111c7]
at
2011-12-12 13:32:50
on branch trunk
— Improve serialization of OFXMLElement.
It does not store the namespaces for the prefixes "xml" and "xmlns"
anymore. (user: js, size: 24730) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
314 315 316 317 318 319 320 321 322 323 324 325 326 327 | namespace: OF_SERIALIZATION_NS] elementsForNamespace: OF_SERIALIZATION_NS] firstObject]; attributes = [[attributesElement objectByDeserializing] copy]; namespaces = [[namespacesElement objectByDeserializing] copy]; children = [[childrenElement objectByDeserializing] copy]; if (name == nil) @throw [OFInvalidArgumentException exceptionWithClass: isa selector: _cmd]; [pool release]; } @catch (id e) { | > > > > > > > > | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | namespace: OF_SERIALIZATION_NS] elementsForNamespace: OF_SERIALIZATION_NS] firstObject]; attributes = [[attributesElement objectByDeserializing] copy]; namespaces = [[namespacesElement objectByDeserializing] copy]; children = [[childrenElement objectByDeserializing] copy]; if (namespaces == nil) namespaces = [[OFMutableDictionary alloc] init]; [namespaces setObject: @"xml" forKey: @"http://www.w3.org/XML/1998/namespace"]; [namespaces setObject: @"xmlns" forKey: @"http://www.w3.org/2000/xmlns/"]; if (name == nil) @throw [OFInvalidArgumentException exceptionWithClass: isa selector: _cmd]; [pool release]; } @catch (id e) { |
︙ | ︙ | |||
710 711 712 713 714 715 716 717 | [attributesElement addChild: [attributes XMLElementBySerializing]]; [element addChild: attributesElement]; } if (namespaces != nil) { OFXMLElement *namespacesElement; | > > > > > > > > | | | | | | > | 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 | [attributesElement addChild: [attributes XMLElementBySerializing]]; [element addChild: attributesElement]; } if (namespaces != nil) { OFXMLElement *namespacesElement; OFMutableDictionary *namespacesCopy = [[namespaces mutableCopy] autorelease]; [namespacesCopy removeObjectForKey: @"http://www.w3.org/XML/1998/namespace"]; [namespacesCopy removeObjectForKey: @"http://www.w3.org/2000/xmlns/"]; if ([namespacesCopy count] > 0) { namespacesElement = [OFXMLElement elementWithName: @"namespaces" namespace: OF_SERIALIZATION_NS]; [namespacesElement addChild: [namespacesCopy XMLElementBySerializing]]; [element addChild: namespacesElement]; } } if (children != nil) { OFXMLElement *childrenElement; childrenElement = [OFXMLElement elementWithName: @"children" |
︙ | ︙ |