Re: [public-qt-comments] <none>

At 12:34 PM 8/19/2002 -0400, Fei Sha wrote:

>in the document: "XML Query Use Cases  W3C Working Draft 16 Aug 2002"
>
>1.1.9.7 Q7
>$b/@year is interpreted as an attribute of the <book>

Yes.

>1.5.4.6 Q6
>List the short titles of all sections (the values of the "shorttitle" 
>attributes of all "section" elements, expressing each short title as the 
>value of a new element.)
>
>If I interprete "...each short title as the value of a new element"
>The result should be:
>
><result>
><stitle>What is markup?</stitle>
><stitle>What is SGML?</stitle>
><stitle>How does SGML work?</stitle>
></result>
>
>Is this interpretation correct?

The text is misleading. The query would actually return:

<result>
<stitle shorttitle="What is markup?"/>
<stitle shorttitle="What is SGML?"/>
<stitle shorttitle="How does SGML work?"/>
</result>

The query could have been written differently to produce the result you 
give, eg:

<result>
  {
   for $s in input()//section/@shorttitle
   return <stitle>{ string-value($s) }</stitle>
  }
</result>

I will change either the query or the text for the next Working Draft.

>What is the expected result of the query:
>
>     for $y in document("www.bn.com/bib.xml")//book/@year
>     return $y

Our answers to use  cases are generally presented as serialized XML text, 
but not every instance of the data model can be serialized as well-formed 
XML. In this case, you have a sequence of attributes, which is a perfectly 
valid query result, but can not be serialized as an XML document. That's 
why we put the attributes into elements in the query in 1.5.4.6 Q6.

Jonathan

Received on Tuesday, 20 August 2002 12:06:34 UTC