This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4864 - 1.0.3dev: K2-CopyNamespacesProlog-1
Summary: 1.0.3dev: K2-CopyNamespacesProlog-1
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Frans Englich
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-18 15:13 UTC by Tim Mills
Modified: 2010-03-16 15:59 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2007-07-18 15:13:55 UTC
In the query:

(:*******************************************************:)
(: Test: K2-CopyNamespacesProlog-1                       :)
(: Written by: Frans Englich                             :)
(: Date: 2007-07-17T17:04:39+01:00                       :)
(: Purpose: Use no-preserve, inherit with the default namespace. :)
(:*******************************************************:)
declare copy-namespaces no-preserve, inherit;
<doc>
    <a>{<b xmlns:p="q"/>}</a>
    <a><b xmlns:p="q"/></a>
</doc>

then expected result is:

<doc>
  <a><b></b></a>
  <a><b xmlns:p=\"q\"></b></a>
</doc>

which we don't quite understand.

On the one hand, reading:

http://www.w3.org/TR/xquery/#id-content

seems to suggest that copying (and therefore the influence of the copy namespaces mode) only comes into play when dealing with enclosed expressions.

However, reading the Formal Semantics document

http://www.w3.org/TR/xquery-semantics/#id_element_constructor

I can't see anything which wuold result in the normalized forms of these two expressions being different.  Specifically, there doesn't seem to be any special rule for enclosed expressions.  Or have I missed something?

Is the expected result of this test correct?
Comment 1 Michael Kay 2007-07-18 17:12:13 UTC
It's fairly bizarre and probably unintended that these two expressions produce different results, but I think the XQuery language book makes it clear that they do. 
Comment 2 Tim Mills 2007-07-19 06:46:21 UTC
Thanks.  Could you elaborate?

Would you agree that this doesn't appear to be reflected in the Formal Semantics?

Comment 3 Michael Kay 2007-07-19 08:30:18 UTC
>Would you agree that this doesn't appear to be reflected in the Formal
Semantics?

I wouldn't dare to venture an opinion. I'm not one of the three people in the world who understands the formal semantics...
Comment 4 Tim Mills 2007-07-19 08:33:31 UTC
:)

I'll raise this as an issue under FS.
Comment 5 Tim Mills 2007-07-19 08:45:19 UTC
Hopefully there will be some follow-up in Bug 4869.
Comment 6 Tim Mills 2007-07-30 12:58:57 UTC
Interestingly, the XQueryX version of this query represents the content of the two <a> tags identically.  This suggests that the distinction between enclosed expressions and 'normal' element content has been missed there too.
Comment 7 Tim Mills 2007-08-03 09:17:45 UTC
From Bug 4869 Comment #3, it seems that the XQueryX version of K2-CopyNamespacesProlog-1 is wrong.
Comment 8 Frans Englich 2007-09-11 14:31:16 UTC
I'm closing this report since it has been concluded that the test case is aligned with the XQuery spec, while FS is not.