ObjFW  Diff

Differences From Artifact [f4ee2b186f]:

To Artifact [e91819cfc0]:


471
472
473
474
475
476
477
478
















479




480
481
482
483
484
485
486

	if (characters != nil)
		return [characters stringByXMLEscaping];

	if (CDATA != nil)
		return [OFString stringWithFormat: @"<![CDATA[%@]]>", CDATA];

	if (comment != nil)
















		return [OFString stringWithFormat: @"<!--%@-->", comment];





	pool = [[OFAutoreleasePool alloc] init];

	if (parent != nil && parent->namespaces != nil) {
		OFEnumerator *keyEnumerator = [namespaces keyEnumerator];
		OFEnumerator *objectEnumerator = [namespaces objectEnumerator];
		id key, object;







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>







471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506

	if (characters != nil)
		return [characters stringByXMLEscaping];

	if (CDATA != nil)
		return [OFString stringWithFormat: @"<![CDATA[%@]]>", CDATA];

	if (comment != nil) {
		OFString *ret;

		if (indentation > 0 && level > 0) {
			char *whitespaces = [self
			    allocMemoryWithSize: (level * indentation) + 1];
			memset(whitespaces, ' ', level * indentation);
			whitespaces[level * indentation] = 0;

			@try {
				ret = [OFString
				    stringWithFormat: @"%s<!--%@-->",
						      whitespaces, comment];
			} @finally {
				[self freeMemory: whitespaces];
			}
		} else
			ret = [OFString stringWithFormat: @"<!--%@-->",
							  comment];

		return ret;
	}

	pool = [[OFAutoreleasePool alloc] init];

	if (parent != nil && parent->namespaces != nil) {
		OFEnumerator *keyEnumerator = [namespaces keyEnumerator];
		OFEnumerator *objectEnumerator = [namespaces objectEnumerator];
		id key, object;
613
614
615
616
617
618
619
620

621
622
623
624
625
626
627
		tmp = [OFMutableString string];
		append = [tmp methodForSelector: appendSel];

		if (indentation > 0) {
			indent = YES;

			for (j = 0; j < childrenCount; j++) {
				if (childrenCArray[j]->name == nil) {

					indent = NO;
					break;
				}
			}
		} else
			indent = NO;








|
>







633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
		tmp = [OFMutableString string];
		append = [tmp methodForSelector: appendSel];

		if (indentation > 0) {
			indent = YES;

			for (j = 0; j < childrenCount; j++) {
				if (childrenCArray[j]->characters != nil ||
				    childrenCArray[j]->CDATA != nil) {
					indent = NO;
					break;
				}
			}
		} else
			indent = NO;