Differences From Artifact [dfde4a28b8]:
- File src/OFXMLElement.m — part of check-in [ace6f683f7] at 2011-05-12 18:27:57 on branch trunk — Add version to serialization and add serialization to more classes. (user: js, size: 18958) [annotate] [blame] [check-ins using]
To Artifact [d290a6e873]:
- File
src/OFXMLElement.m
— part of check-in
[494dca4ae4]
at
2011-05-14 12:26:39
on branch trunk
— Use XML for serialization.
This way, we don't need a new parser and don't use a new format. (user: js, size: 19916) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
564 565 566 567 568 569 570 | } - (OFString*)description { return [self XMLString]; } | | | > | > > | > > > > > > > | | > > > | | > | > | > | > > | | | < < < < < < < < < < < | | | | | > > | | > > | > | | > > | > > > > > > | > > > > > | > > > > > | > > > > > > > | | 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | } - (OFString*)description { return [self XMLString]; } - (OFXMLElement*)XMLElementBySerializing { OFAutoreleasePool *pool; OFXMLElement *element; element = [OFXMLElement elementWithName: @"object" namespace: OF_SERIALIZATION_NS]; pool = [[OFAutoreleasePool alloc] init]; [element addAttributeWithName: @"class" stringValue: [self className]]; if (name != nil) [element addChild: [OFXMLElement elementWithName: @"name" namespace: OF_SERIALIZATION_NS stringValue: name]]; if (ns != nil) [element addChild: [OFXMLElement elementWithName: @"namespace" namespace: OF_SERIALIZATION_NS stringValue: ns]]; if (defaultNamespace != nil) [element addChild: [OFXMLElement elementWithName: @"defaultNamespace" namespace: OF_SERIALIZATION_NS stringValue: defaultNamespace]]; if (attributes != nil) { OFXMLElement *attributesElement; attributesElement = [OFXMLElement elementWithName: @"attributes" namespace: OF_SERIALIZATION_NS]; [attributesElement addChild: [attributes XMLElementBySerializing]]; [element addChild: attributesElement]; } if (namespaces != nil) { OFXMLElement *namespacesElement; namespacesElement = [OFXMLElement elementWithName: @"namespaces" namespace: OF_SERIALIZATION_NS]; [namespacesElement addChild: [namespaces XMLElementBySerializing]]; [element addChild: namespacesElement]; } if (children != nil) { OFXMLElement *childrenElement; childrenElement = [OFXMLElement elementWithName: @"children" namespace: OF_SERIALIZATION_NS]; [childrenElement addChild: [children XMLElementBySerializing]]; [element addChild: childrenElement]; } if (characters != nil) [element addChild: [OFXMLElement elementWithName: @"characters" namespace: OF_SERIALIZATION_NS stringValue: characters]]; if (CDATA != nil) [element addChild: [OFXMLElement elementWithName: @"CDATA" namespace: OF_SERIALIZATION_NS stringValue: CDATA]]; if (comment != nil) [element addChild: [OFXMLElement elementWithName: @"comment" namespace: OF_SERIALIZATION_NS stringValue: comment]]; [pool release]; return element; } - (void)addAttribute: (OFXMLAttribute*)attribute { if (name == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; |
︙ | ︙ |