Skip to content

fn:element-to-map: restore content-key collision handling - #2770

Merged
ChristianGruen merged 2 commits into
BaseXdb:mainfrom
GuntherRademacher:element-to-map-227
Sep 29, 2026
Merged

ChristianGruen merged 2 commits into
BaseXdb:mainfrom
GuntherRademacher:element-to-map-227

Conversation

@GuntherRademacher

Copy link
Copy Markdown
Member

QT4 test element-to-map-227 for fn:element-to-map failed:

element-to-map(parse-xml('<a id="zz">babel</a>')/a, {'content-key': '@id'})
Result: { "a": { "@id": array { ("zz", "babel") } } }
Expect: { "a": { "@id": "zz", "#@id": "babel" } }

Commit f56348b applied the general array-based handling of duplicate map keys to collisions involving content-key. However, the specification defines a specific rule for such collisions: # characters are prepended to the requested content key until it is unique. This change restores the previous collision handling for content-key while retaining array-based handling for other duplicate-key cases.

@GuntherRademacher
GuntherRademacher marked this pull request as draft September 29, 2026 09:05
@GuntherRademacher
GuntherRademacher marked this pull request as ready for review September 29, 2026 09:32
@ChristianGruen
ChristianGruen merged commit c62b380 into BaseXdb:main Sep 29, 2026
1 check passed
@ChristianGruen
ChristianGruen deleted the element-to-map-227 branch September 29, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants