Re: [XQuery, May 2] Example 3.7.2.3 missing braces

Michael,
Thanks for your suggestions. I'll fix the errors in the next edition of 
the document.
Specifically:

(1) I will add the missing curly braces to the example document node 
constructor in Section 3.7.2.3. I believe that the example will then be 
correct. The path expression doc("bib.xml")//book/author returns a 
sequence of zero or more author elements, not a document node.

(2) In the first example of Section 3.7.2.1, the use of the function 
node-name($e) to compute the node name of the constructed element is an 
example of a reasonable and valid query that is nevertheless considered to 
be a "type error" by our conservative rules for static type checking. 
There are a great many such examples. That is why type checking is 
optional in XQuery. A system that performs dynamic type checking will 
execute this query without any problem. A system that performs only static 
type checking will be unable to execute this useful query.

(3) In the second example of Section 3.7.2.1, I will insert a "data" 
function call into the name expression to fix the bug you have noted. The 
name expression will then look like this:
{data($dict/entry[word=name($e)]/variant[lang="Italian"])}

Regards,
--Don

Received on Monday, 23 June 2003 13:33:15 UTC