- From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
- Date: Thu, 3 Jan 2002 10:09:50 -0500
- To: ht@cogsci.ed.ac.uk (Henry S. Thompson), David Carlisle <davidc@nag.co.uk>
- Cc: www-xml-query-comments@w3.org, xml-dev@lists.xml.org
At 1:38 PM +0000 1/3/02, Henry S. Thompson wrote: >I think there's a confusion here. XPath and XQuery are expression >languages. There's no such thing as an 'XQuery document' as such, as >far as I understand. You can embed XPath and/or XQuery expressions in >XML documents any way you like. So the following is perfectly OK: > ><myQR> ><bib> > { > for $b in document("http://www.bn.com")/bib/book > where $b/publisher = "Addison-Wesley" and $b/@year > 1991 > return > <livre année={ $b/@year }> > <créateur> { $b/author } </créateur> > { $b/title } > </livre> > } ></bib> ></myQR> > Henry, You just convinced me that David is absolutely 100% right. That is so ugly and so horribly confusing to users, that I can't possibly see accepting it. If a legal XQuery can't be pasted straight into an XML document without escaping all the left angle brackets or wrapping it in a CDATA section, then this format isn't going to fly. 50% XML, 50% meat by-product XQuery is not healthy. It will confuse users and developers. There are two ways to fix this: 1. The XSLT solution: Make all XQueries complete, well-formed, XML documents 2. The XPath solution: Make all XQueries look nothing like XML documents; i.e. no tags, no elements, no attributes But pick one or the other. Be hot or cold. If XQuery is lukewarm about XML syntax, users will vomit it out of their mouths. -- +-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer | +-----------------------+------------------------+-------------------+ | The XML Bible, 2nd Edition (Hungry Minds, 2001) | | http://www.ibiblio.org/xml/books/bible2/ | | http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/ | +----------------------------------+---------------------------------+ | Read Cafe au Lait for Java News: http://www.cafeaulait.org/ | | Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/ | +----------------------------------+---------------------------------+
Received on Thursday, 3 January 2002 10:11:03 UTC