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 29149 - [XSLT30] XTDE0420 on attributes/namespaces in document nodes
Summary: [XSLT30] XTDE0420 on attributes/namespaces in document nodes
Status: CLOSED WORKSFORME
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-24 09:09 UTC by Abel Braaksma
Modified: 2015-10-29 12:42 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2015-09-24 09:09:27 UTC
In section 5.8.1 Constructing Complex Content, we write in step 7

[ERR XTDE0420] It is a dynamic error if the result sequence used to construct the content of a document node contains a namespace node or attribute node.

However, in step 4 we write:

4. Any document node within the result sequence is replaced by a sequence containing each of its children, in document order.

So, after step 4 we have removed the document nodes. While I understand that this rule is here to prevent a document node to have namespace or attribute nodes, in an earlier step we have already removed any document nodes, resulting in this error never being thrown.

I think the effect is depth-first, which means that we can only reach step 4 after in a previous cycle we reached step 7 for the children. Perhaps we can swap these rules for clarity?
Comment 1 Michael Kay 2015-09-24 21:44:09 UTC
XTDE0420 is about constructing document nodes, it applies when the containing instruction is xsl:document, xsl:result-document, or xsl:copy with the context item being a document node. This has nothing to do with whether the value of the sequence delivered by the sequence constructor contains any document nodes; furthermore replacing a document node by its children will never cause the sequence to contain attribute or namespace nodes because they cannot occur as children of a document node.
Comment 2 Abel Braaksma 2015-09-25 02:22:57 UTC
Let's close this with no action. The ambiguity came from a recent scan through this section. We implemented it the way you describe it, so there are no practical implications.