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 8815 - [XSLT 2.0] Validation applied to nodes other than elements and attributes
Summary: [XSLT 2.0] Validation applied to nodes other than elements and attributes
Status: RESOLVED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
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: 2010-01-25 19:03 UTC by Michael Kay
Modified: 2010-01-25 21:25 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2010-01-25 19:03:50 UTC
What happens when the user specifies the validation or type attributes on the xsl:copy or xsl:copy-of instructions, and the value returned by this instruction is a node other than an element or attribute node, or indeed an atomic value? The specification does not appear to answer this question.

I would propose:

(a) validation = (preserve | strip | lax) is a no-op: the validation attribute is ignored, and the supplied item is copied as-is.

(b) validation = strict causes a type error

(c) type = type-name causes a type error
Comment 1 Henry Zongaro 2010-01-25 21:07:30 UTC
I almost submitted this same bug report a few months ago, until I noticed that sections 11.9.1[1] and 11.9.2[2] state that the 'validation' and 'type' attributes are ignored when copying anything other than a document, element or attribute node.

In the paragraph following the second note in section 11.9.1, we have "The optional attributes type and validation may be used on the xsl:copy instruction.... These attributes are ignored when copying an item that is not an element, attribute or document node."

In the paragraph following the bulleted list in section 11.9.2, we have "The optional attributes type and validation may be used on the xsl:copy-of  instruction.... These attributes are applied individually to each element, attribute, and document node that is selected by the expression in the select attribute. These attributes are ignored when copying an item that is not an element, attribute or document node."

[1] http://www.w3.org/TR/xslt20/#shallow-copy
[2] http://www.w3.org/TR/xslt20/#copy-of
Comment 2 Michael Kay 2010-01-25 21:25:58 UTC
Thanks, Henry!