Or you can resolve the QName and compare to a constructed QName in no 
nampespace.  XQuery makes it quite difficult to deal with elements in no 
namespace when there is a default namespace in play, but it is possible,  It is 
ugly, but it can be done.  Something like:

xquery version "1.0-ml";

declare default element namespace "foo";

let $x := <foo xmlns=""><id>hello</id></foo> 
return
$x//*[fn:QName(fn:namespace-uri(.), fn:local-name(.)) 
      eq fn:QName("", "id")]

=>
<id xmlns="">hello</id>

-Danny

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Geert Josten
Sent: Tuesday, September 07, 2010 3:05 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] sequence of elements

Hi Mano,

> <x>{$item/self::*[local-name(.) eq "ID"]}</x>

Not likely quicker, but more readible if you write it like this:

<x>{$item/self::*:ID}</x>

*:ID means element with local-name ID but in any namespace..

Kind regards,
Geert


drs. G.P.H. (Geert) Josten
Consultant

Daidalos BV
Hoekeindsehof 1-4
2665 JZ Bleiswijk

T +31 (0)10 850 1200
F +31 (0)10 850 1199

mailto:[email protected]
http://www.daidalos.nl/

KvK 27164984


De informatie - verzonden in of met dit e-mailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to