[sc34wg3] TMQL and XML

Robert Barta rho at devc.at
Mon Oct 29 03:54:33 EDT 2007


On Thu, Oct 25, 2007 at 05:27:16PM +0200, Lars Heuer wrote:
> I wonder if the "XML allowed anywhere" policy (simplification) of TMQL
> introduces an unnecessary complexity.
> 
> a) If I understand the current draft correctly, the following queries are
>    valid:
> 
>    i) select $x from <html>
>                         <head>
>                            <title>XML</title>
>                         </head>
>                         <body>
>                           <p>A paragraph</p>
>                         </body>
>                       </html>
> 
> 
>    ii) for $x in <xml><here/></xml>
>        return $x
> 
>    Question: Do we need that? Is it possible to limit the XML stuff to
>    the "return" clause of the FLWOR clauses?

Question: What is more complex? Allowing it everywhere, or disallowing
it in particular places, but not in others?

For me "flat" means "everywhere". And "flat" equates to "simple".

> b) In XQuery it is not allowed to use
> 
>       [...]
>       return <{$x}>bla bla<{$x}/>
> 
>    Embedded expressions are not allowed for XML elements, the user has
>    to use specialised constructors.
> 
>    Question: Do we need such a feature and has the XQuery group maybe
>    good reasons to disallow such constructs?

That was discussed at length in Oslo. The draft at that time did not
allow to inline create

  - element name content such as <abc{$x}def/>
  - attribute name content such as <abc some{$x}attr ....

When these features were added, LMG also brought up that XSLT and
XQuery would not allow this compact notation but instead

   <xsl:element name=".....">
     <xsl:attribute name="...."

_THAT_ is definitely more difficult to parse, I think.

\rho
-- 
And then he said: "You should read my blog." http://kill.devc.at/


More information about the sc34wg3 mailing list