This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Although the narrative description of the snapshot() function indicates that a documetn node at the root of the source tree should be copied, the XSLT specimen implementation of the function leaves the result with no document node at its root. This is because the template rule <xsl:template match="node()" mode="snapshot"> does not apply to document nodes (only to child nodes(), and the built-in template for document nodes does a "shallow skip", that is, it does not create a document node in the result tree. Similar problems occur when the argument to snapshot() is a parentless attribute or namespace node: the node is not matched and is therefore not copied. Possible fixes are either (a) to change match="node()" to match=".", or (b) to add on-no-match="shallow-copy" to the mode declaration.
I have fixed this by changing the template rule to say match=".". I have created test cases that test the supplied stylesheet.