-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
XQuery Update ignores namespace binding conflict #1482
Comments
still happening in 4.2.1 and 5.0.0 RC |
we should add these as pending tests |
Agreed. |
Test still fails in eXist 5.0.0. |
@joewiz Hmmm... would I not expect to get the result: <x xmlns:myns="http://www.bar.com">
<z xmlns:myns="http://www.foo.com" myns:baz="qux"/>
</x> |
@adamretter Yes, that would certainly be a valid result. However, eXist 5.2.0 returns the following result: <x xmlns:myns="http://www.bar.com">
<z myns:baz="qux"/>
</x> This is an incorrect result, since the |
Is this considered a breaking change? As the milestone is set to v7. |
See the semantics numbered list under the examples in the spec here - https://www.w3.org/TR/xquery-update-10/#id-insert
The definition of
|
@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. Check node/attributes inserted recursively. TBD - can subtrees of the inserted node be in different namespaces ? Do we need to deal with namespaces introduced in the insertion ?
@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.
@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.
@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.
What is the problem
eXist's XQuery Update facility overlooks namespace binding conflicts when inserting attributes. For example, given a query whose prolog binds the namespace prefix
myns
to the URIhttp://www.foo.com
, an update expression in that query to insert an attributemyns:baz="qux"
into a document wheremyns
is bound to a different namespace URI, likehttp://www.bar.com
, succeeds, despite the conflicting namespace bindings on the prefixmyns
.What did you expect
I expected an error to be raised — along the lines of what Saxon raises:
For more on this error, see https://www.w3.org/TR/xquery-update-30/#ERRXUDY0023. (While eXist's XQuery Update spec isn't aligned with the W3C spec, it seems reasonable that a namespace binding conflict should raise an error.)
Describe how to reproduce or add a test
The equivalent test in Saxon:
test.xml
test.xq
Running this test in oXygen 19.0 (build 2017062918), the result is:
Context information
The text was updated successfully, but these errors were encountered: