[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: The use of XML syntax in XML Query


xquery synta
At 03:11 PM 1/3/2002 -0500, Elliotte Rusty Harold wrote:
>For me yes, but that's not the point. We are asking you to get rid of the 
>pseudo-XML syntax. We are not asking you to add a new syntax. If you 
>deleted the pseudo-XML syntax and relied completely on the computed 
>element constructor syntax then I'd be happy.

The computed element constructor syntax already exists, and would not need 
to be added. I agree that ditching the XML constructor syntax would not 
delay XQuery at all - it would also make it easier to parse.

However, I think that a lot of people like the XML constructor syntax, 
because if you want to construct XML, you can simply type in the equivalent 
XML text, or copy it from an existing document.

>Not to mention this would make the specs smaller, easier to understand, 
>easier to learn, and easier to implement. I don't see the point here of 
>two completely equivalent ways to accomplish exactly the same thing, 
>especially when one of those ways is guaranteed to confuse users and 
>developers.

The reason for computed element constructor syntax was originally to allow 
the names of elements and attributes to be constructed at run-time. We 
added this after the XML constructor syntax was already in place. For 
instance, given a variable $b that contains the name of an element, you can 
create an element like this:

         element { $b }
         {
                 attribute id { "id102" },
                 "This is the text of the element"
         }

If we know the name of the element in advance, we can use either of the 
following syntaxes:

         element foo
         {
                 attribute id { "id102" },
                 "This is the text of the element"
         }

or

         <foo id="id102">This is the text of the element</foo>

I think that using XML syntax is intuitive to people who know XML. And 
although not all of XML is supported, the XQuery element constructors 
really do construct the same thing as the equivalent XML text would 
construct, except that (1) curly braces { } escape to native XQuery synta, 
and (2) some things like entities (other than predefined character 
references) and encodings are not supported.

That said, if our various communities would say loudly to us that we should 
drop the XML syntax, I would not have particularly strong objections to that.

Jonathan


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.