Re: [xml-dev] text nodes of document in XDM

From
David Carlisle <>
To
David Lee <>
Date
2011-01-11T22:05:24Z
ID
<>
Thread
Re: [xml-dev] text nodes of document in XDM
On 11/01/2011 20:22, David Lee wrote:
> When is a document node created implicitly ?
>
> If I run the xquery
> 	1,"hi",<foo/>
>
> I do NOT get a document node.
>
>

step 7 of

http://www.w3.org/TR/xslt-xquery-serialization/#serdm

so if you use some API that gives direct access to the XD< sequences 
there is no implicit parent, but if (as is the specified default for 
xslt and not uncommon for xquery) the result is returned using the xml 
serialisation then an implict document node is produced.

there is an xsl:document in xslt to generate a document node explicitly 
but it is almost never used (and xslt 1 didn't have such a construct at all)

node copying in both xquery and xslt is designed to silently throw away 
these document node containers, if you copy a document node into another 
document element, it isn't an error you simply get the document nodes 
children.

David