[xquery-talk] QName in content

David Lee dlee at calldei.com
Wed Nov 24 13:38:40 PST 2010

Funny you should ask, I stumbled on this literally a few days ago while
implementing the QName function for xmlsh




The results were not obvious but they did make sense.   I didn't dig into
the specs, but what Saxon does (and now xmlsh which uses saxon) makes sense.
When converting a QName to a string, the same thing takes place as if you
were to create an attribute or element.

If there's a prefix its used and if not no prefix is used. The URI is

So your result produces 




Eg. in xmlsh (which calls saxon's xquery)


$ echo <[ <a>{ QName("uri","local") }</a> ]>



I think this makes perfect sence *in hindsight*







David A. Lee

 <mailto:dlee at calldei.com> dlee at calldei.com

 <http://www.xmlsh.org> http://www.xmlsh.org


From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf
Of Daniela Florescu
Sent: Wednesday, November 24, 2010 1:24 PM
To: talk at x-query.com Talk
Subject: [xquery-talk] QName in content


I am 14 years into XQuery, and this language still puzzles me.

(I guess we need the surprise factor to keep the interest alive :-)


What do people think the following query 


<a>{ QName("uri","local") }</a>


(a) does return according to the spec


(b) should return based on your own user expectation ?



Is everybody OK with the current specification ? Any opinions ?


Thanks in advance, best regards





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20101124/d54bb0ef/attachment.htm

More information about the talk mailing list