Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix namespace binding conflict errors with XQuery Update #4545

Conversation

alanpaxton
Copy link
Collaborator

@alanpaxton alanpaxton commented Sep 7, 2022

Description:

Report an error (XUDY0023) when an insertion is attempted with a node or attribute name in a namespace that conflicts with one which exists in the document.

References:

Closes #1482

See https://www.w3.org/TR/xquery-update-30/#dt-conflict

Recursively check node/attributes inserted into a document for namespace conflicts. This change does not look at namespaces introduced in the subtrees being inserted, it appears these correctly respect the namespace in the subtree rather than the declared namespace in the XQuery context in which the insertion happens.

Type of tests:

Added unit tests in binidingConflict.xqm for correct reporting of binding conflict errors

@alanpaxton alanpaxton marked this pull request as draft September 7, 2022 07:15
@alanpaxton alanpaxton force-pushed the feature/xquery-update-30,binding-conflict-error branch from 8d7bf04 to 498b188 Compare September 7, 2022 13:53
@see eXist-db#1482

Report an error (XUDY0023) when an insertion is attempted with a node or attribute name in a namespace that conflicts with one which exists in the document.

@see https://www.w3.org/TR/xquery-update-30/#dt-conflict

Check node/attributes inserted recursively. This change does not look at namespaces introduced in the subtrees being inserted, so there is still potential for a conflict in the final tree.
We will consider rejecting conflicting namespaces introduced in the insertion in a later change.
@alanpaxton alanpaxton force-pushed the feature/xquery-update-30,binding-conflict-error branch from 498b188 to 441feab Compare September 8, 2022 14:41
Copy link
Contributor

@adamretter adamretter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamretter adamretter marked this pull request as ready for review October 5, 2022 18:18
@adamretter adamretter added the bug issue confirmed as bug label Oct 5, 2022
@adamretter adamretter added this to the eXist-6.0.2 milestone Oct 5, 2022
@sonarcloud
Copy link

sonarcloud bot commented Oct 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

90.6% 90.6% Coverage
0.0% 0.0% Duplication

@adamretter adamretter merged commit 2d38490 into eXist-db:develop Oct 10, 2022
@adamretter adamretter changed the title [bugfix] - namespace binding conflict errors Fix namespace binding conflict errors with XQuery Update Oct 10, 2022
@adamretter adamretter deleted the feature/xquery-update-30,binding-conflict-error branch November 28, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XQuery Update ignores namespace binding conflict
2 participants