[Bug 1250] [XQuery] the typed value of a document node

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1250





------- Additional Comments From mike@saxonica.com  2005-04-14 20:12 -------
The reason for the rule you refer to is backwards compatibility with XSLT 1.0.
Here it is very common for users to use constructs such as

<xsl:variable name="x">
[<xsl:value-of select="d"/>]
</xsl:variable>

and then use $x as if it were a string.

Here the value of $x is a document node, which has a single text node child.
There is no root element. It's also common to see constructs like

<xsl:variable name="lookup">
<a code="12" value="red"/>
<a code="13" value="blue"/>
<a code="14" value="green"/>
</xsl:variable>

where the document has several element nodes among its children.

Michael Kay

Received on Thursday, 14 April 2005 20:12:12 UTC