Hi Paul,

I cannot reproduce your output. What version are you running? I am running 
4.1-1, and that complains that you are not passing xs:Qname's as arguments. 
This code works as expected for me:

xquery version "0.9-ml"

let $x := <hello xmlns="dude" 
xmlns:w="wns"><w:what>2</w:what><goodbye>1</goodbye></hello>

let $child1 := $x/child::element()[1]
return
(
$child1,fn:node-name($child1),
fn:prefix-from-QName(fn:node-name($child1)),  
fn:namespace-uri-from-QName(fn:node-name($child1))
)

Kind regards,
Geert

>


Drs. G.P.H. Josten
Consultant


http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - 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.


> From: [email protected]
> [mailto:[email protected]] On Behalf Of Paul M
> Sent: dinsdag 15 september 2009 21:39
> To: [email protected]
> Subject: [MarkLogic Dev General] Namespaces behavior
>
> let $x := <hello xmlns="dude"
> xmlns:w="wns"><w:what>2</w:what><goodbye>1</goodbye></hello>
>
> return
> (
> $x/child::element()[1],fn:node-name($x/child::element()[1]),
> fn:prefix-from-QName($x/child::element()[1]),
> fn:namespace-uri-from-QName($x/child::element()[1])
> )
>
> (:
> What is returned:
>
> <w:what xmlns="dude" xmlns:w="w">2</w:what> what
> -
> dude
>
> Expected:
>
> <w:what xmlns="dude" xmlns:w="w">2</w:what> what w wns
>
> :)
>
>

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

Reply via email to