[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


javacc utf 16
At 03:37 PM 1/3/2002 +0000, David Carlisle wrote:

> > The basic idea is that any construct in XQuery that looks like XML is a
> > constructor for the same construct.
>
>But it is not XML syntax it is just syntax that looks a bit like some
>bits of XML. That is the problem.

Well, I disagree that this is a problem.

Suppose you want to create an XML document with dynamic content. You can 
take an existing XML document and modify it by adding query expressions. 
The original XML document is treated as an element constructor.

> > My assumption has been that queries would be written in Unicode.
>but what does that mean?
>Unicode is a set of characters but what is the encoding used? utf16? utf8?

Yes, this needs to be more precisely specified than it is in the current 
specification.

> > However, perhaps it would make sense to require
> > XQuery processors to also accept queries in an XML document that simply
> > embeds the query in an element:
>
>currently the only safe way to embed Xquery in XML is to stick the whole
>lot in a CDATA section or equivalently quote each <

Actually, I do not think this is true. You can also use XQueryX or computed 
element constructor syntax.

> > How important is it to be able to write queries in any encoding you
> > want?
>
>If you want to get an answer to that question, don't ask an English
>mathematician:-) It was thought crucially important in the design of
>XML. Have you (the Query WG) asked the W3C I18n group to review this issue?

Frankly, we haven't really been discussing encoding issues in any depth to 
date. We should do so, and the I18N should be involved.

> >  I would hope that the XSLT
> > author knows exactly what they are doing when they do that kind of XML
> > quoting,
> >
>In typical situations they don't even know it is happening at all. If
>you write out Xpath's from XSLT (for example) then ultimately it is the
>system not the author that decides what encoding is used and whether any
>particular character will be output as character data or a numeric
>character reference.

But if the author has no idea what the processor will do, the author is up 
a creek. Surely the author needs to understand the meaning of an XPath, or 
get unexpected results.

> >  In XQuery, it
> > is important that element constructors are expressions that have a
> > well-known type, not a black-box way of creating nodes. Element
> > constructors should be present in both the grammar and the type system.
>
>The tokens in the Xquery grammar can be infoset items resulting from a
>preliminary XML parse, as in XSLT. You don't have to specify the grammar
>down to the level of characters, thus duplicating so much of XML.

One of the design goals of XQuery is to be easily parsed using conventional 
tools like lex and yacc or JavaCC.  These have no notion of the XML 
Information Set.

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.