W3C home > Mailing lists > Public > www-ql@w3.org > October to December 2004

RE: default namespace in constructed element

From: Michael Rys <mrys@microsoft.com>
Date: Tue, 21 Dec 2004 12:40:04 -0800
Message-ID: <BAE415CEAA831548800F68C44E905AF501274694@RED-MSG-60.redmond.corp.microsoft.com>
To: "Michael Kay" <mhk@mhk.me.uk>, "Bas de Bakker" <bas@x-hive.com>, <www-ql@w3.org>

I think it is clear that default element namespaces should be avoided in
XQueries that perform construction.

Best regards
Michael

> -----Original Message-----
> From: www-ql-request@w3.org [mailto:www-ql-request@w3.org] On Behalf
Of
> Michael Kay
> Sent: Tuesday, December 21, 2004 9:58 AM
> To: 'Bas de Bakker'; www-ql@w3.org
> Subject: RE: default namespace in constructed element
> 
> 
> Yes, I missed that. In fact, managing source and result documents with
> different default namespaces is really quite difficult in XQuery.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> > -----Original Message-----
> > From: www-ql-request@w3.org [mailto:www-ql-request@w3.org] On
> > Behalf Of Bas de Bakker
> > Sent: 21 December 2004 11:55
> > To: www-ql@w3.org
> > Subject: RE: default namespace in constructed element
> >
> >
> > But (according to section 3.7.1.2 of the current XQuery WD) the
> > namespace declaration does change the default namespace for the
> > constructor expression.  Therefore, the path expression will look
for
> > elements "a" in the namespace "www.xyz.com" and return the empty
> > sequence.  In other words, the element will not be inserted at all.
> >
> > Bas de Bakker
> > X-Hive Corporation
> >
> > > -----Original Message-----
> > > From: www-ql-request@w3.org
> > [mailto:www-ql-request@w3.org]On Behalf Of
> > > Michael Kay
> > > Sent: Tuesday, December 21, 2004 12:03
> > > To: 'Leonid Novak'; www-ql@w3.org
> > > Subject: RE: default namespace in constructed element
> > >
> > >
> > >
> > > No, it shouldn't change the namespace URI of element <a>.
> > The element
> > > selected within the {} is copied unchanged - that means it
> > retains its
> > > original name (both the local name and the namespace URI).
> > In order to
> > > achieve this, the system will probably need to generate an
xmlns=""
> > > namespace undeclaration when the result tree is serialized.
> > >
> > > Michael Kay
> > > http://www.saxonica.com/
> > >
> > > > -----Original Message-----
> > > > From: www-ql-request@w3.org [mailto:www-ql-request@w3.org] On
> > > > Behalf Of Leonid Novak
> > > > Sent: 21 December 2004 09:06
> > > > To: www-ql@w3.org
> > > > Subject: default namespace in constructed element
> > > >
> > > >
> > > > Consider, we have the document a.xml: <?xml version="1.0"?><a/>
> > > >
> > > > and the following expression:
> > > >
> > > > <b xmlns="www.xyz.com">{doc("a.xml")//a}</b>
> > > >
> > > > I'm puzzled about the result of the expression: i.e should
> > > the default
> > > > namespace declaration change the URI of  the insereted
> > > > element from document
> > > > "a.xml" or not?
> > > >
> > > > Regards, Leonid Novak
> > > > www.modis.ispras.ru
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> 
Received on Tuesday, 21 December 2004 20:40:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:43:43 UTC