Commit 6a0e37a
fix: resolve toXmlName collision when distinct column names sanitize to the same tag
Column names like '- ' and '_- ' both sanitize to '_-_' via toXmlName,
causing a round-trip failure where two input columns produce identical
XML element names and readXml collapses them into one column.
Build a resolvedTags array before serializing that guarantees unique
element names by appending _1, _2, … suffixes to any collisions.
Fixes property test: readXml / toXml — property tests > round-trip:
toXml then readXml preserves shape
Counterexample: [["- ","_- "],1] seed=-849925200
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 182045c commit 6a0e37a
1 file changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
504 | 521 | | |
505 | 522 | | |
506 | 523 | | |
| |||
511 | 528 | | |
512 | 529 | | |
513 | 530 | | |
514 | | - | |
515 | | - | |
| 531 | + | |
| 532 | + | |
516 | 533 | | |
517 | 534 | | |
518 | 535 | | |
519 | 536 | | |
520 | 537 | | |
521 | 538 | | |
522 | 539 | | |
523 | | - | |
| 540 | + | |
524 | 541 | | |
525 | 542 | | |
526 | 543 | | |
| |||
0 commit comments