This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
ForExprType009 uses namespace prefixes in the result file that were not present in the source file. Since this query is selecting elements from the source document (it is not creating new elements) the namespace prefixes that were present in nodes in the source document should be retained in the serialization. The error affects both versions of the expected results.
Fixed typo
This error is still present in version 0.8.4.
I checked in the latest CVS sources and the namespaces for the query, results and source file all seem to match up (http://www.w3.org/XQueryTestOrderBy). Possibly this change hasn't made it into an official release yet. If you see this again, can you include the file names for the query/results where the wrong namespace appears, as well as the incorrect namespace string.
This error seems still to be present in 0.8.6 The expected result for ForExprType009 reads as follows: <xqt:NegativeNumbers xmlns:xqt="http://www.w3.org/XQueryTestOrderBy">... Where it should be: <NegativeNumbers xmlns="http://www.w3.org/XQueryTestOrderBy">
I beleive the expected results that are listed in the catalog are correct. The query reads as follows: for $num as element(xqt:NegativeNumbers) in $input- context/xqt:DataValues/xqt:NegativeNumbers return $num Therefore, the outer container element (NegativeNumbers) will be in the xqt namespace, not in the 'no-namespace' namespace.
The issue is not what namespace (URI) the element should be in, but what prefix it should have. That was made clear when I first raised this bug report. Michael Kay
So, the core issue here is the prefix of the root element. In the source document, there is a default namespace that this element appears in. In the query, we change this to an explicit namespace. Michael beleives that we should preserve the fact that the origional soruce document had a default namespace. As far as I know, there is no requirement in the language that says we have to preserve these namespaces - so we should be able to replace the default element namespace with an explicit namespace prefix. I have been out of the loop on this for a while now, so I am not sure this is true anymore :) I assigned this bug back to Andrew for discussion within the TTF.
The query is this: for $num as element(xqt:NegativeNumbers) in $input-context/xqt:DataValues/xqt:NegativeNumbers return $num This is selecting a sequence of elements in the source document (a singleton set, as it happens), and serializing them. The elements in the source document have a node-name() property which is a triple: (prefix="", uri="http://www.w3.org/XQueryTestOrderBy", local="NegativeNumbers"). The effect of the "sequence normalization rules" in section 2 and the "round-tripping" rules in section 5 of the serializer spec is that the node-name property of the nodes (all three components) must be preserved through serialization. The query does not modify the source document, and the namespace prefixes used in the query are not visible to the serializer, so there can be no doubt that the prefix in the serialized output must be the same as in the input, that is, the empty prefix "". Michael Kay
In XQTS 0.9.0, there are 2 expected results for the test ForExprType009 ForExprType009.xml is correct, it uses the default namespace. However, the alternate result ForExprType009-1.xml still assumes incorrectly the xqt prefix: <xqt:NegativeNumbers xmlns:xqt="http://www.w3.org/XQueryTestOrderBy">... Where it should be: <NegativeNumbers xmlns="http://www.w3.org/XQueryTestOrderBy">... Thanks, Marc
Marc/Michael: We discussed this issue at the telecon today and agreed that the prefix be removed from th etop element,that is <xqt:NegativeNumbers xmlns:xqt="http://www.w3.org/XQueryTestOrderBy">... Where it should be: <NegativeNumbers xmlns="http://www.w3.org/XQueryTestOrderBy"> I am not sure if the additional file is actually necessary. Leaving it there for now. I will mark this bug as fixed. Thanks, Carmelo
Carmelo, concerning your question: > I am not sure if the additional file is actually necessary. > Leaving it there for now. Both results are needed; one for PSVI-based implementations, the other for Infoset ones. As you probably remember, various bugs on this subject have been filed in the past. I hope this helps, Marc
Comment #10 does not seem to be fixed in 9.4.0
Marc: Correct. This is my oversight. Corrected alternate results. Thanks, Carmelo