Differences From Artifact [0b50609229]:
- File src/OFXMLElement.m — part of check-in [3af65b5d98] at 2018-06-16 14:21:29 on branch trunk — OFXMLElement: Add a few extra type checks (user: js, size: 26472) [annotate] [blame] [check-ins using]
To Artifact [8558828739]:
- File
src/OFXMLElement.m
— part of check-in
[0ec6f9c1d9]
at
2018-06-16 14:36:35
on branch trunk
— OFXML*: Remember delimiter of attributes
This means that if OFXMLParser parsed double-quoted attributes,
OFXMLElement will emit them with double-quotes again. (user: js, size: 26596) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
521 522 523 524 525 526 527 | i += [_namespace UTF8StringLength]; cString[i++] = '\''; } /* Attributes */ for (OFXMLAttribute *attribute in _attributes) { void *pool2 = objc_autoreleasePoolPush(); | > > | > > | | | | | < | | | 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | i += [_namespace UTF8StringLength]; cString[i++] = '\''; } /* Attributes */ for (OFXMLAttribute *attribute in _attributes) { void *pool2 = objc_autoreleasePoolPush(); const char *attributeNameCString = [attribute->_name UTF8String]; size_t attributeNameLength = [attribute->_name UTF8StringLength]; OFString *attributePrefix = nil; OFString *tmp = [[attribute stringValue] stringByXMLEscaping]; char delimiter = (attribute->_useDoubleQuotes ? '"' : '\''); if (attribute->_namespace != nil && (attributePrefix = [allNamespaces objectForKey: attribute->_namespace]) == nil) @throw [OFUnboundNamespaceException exceptionWithNamespace: [attribute namespace] element: self]; length += attributeNameLength + (attributePrefix != nil ? [attributePrefix UTF8StringLength] + 1 : 0) + [tmp UTF8StringLength] + 4; @try { cString = [self resizeMemory: cString size: length]; } @catch (id e) { [self freeMemory: cString]; @throw e; } cString[i++] = ' '; if (attributePrefix != nil) { memcpy(cString + i, [attributePrefix UTF8String], [attributePrefix UTF8StringLength]); i += [attributePrefix UTF8StringLength]; cString[i++] = ':'; } memcpy(cString + i, attributeNameCString, attributeNameLength); i += attributeNameLength; cString[i++] = '='; cString[i++] = delimiter; memcpy(cString + i, [tmp UTF8String], [tmp UTF8StringLength]); i += [tmp UTF8StringLength]; cString[i++] = delimiter; objc_autoreleasePoolPop(pool2); } /* Children */ if (_children != nil) { OFMutableData *tmp = [OFMutableData data]; |
︙ | ︙ |