Hi Mike,

You are looking for something like this:

xquery version "1.0";

declare namespace cat="http://datypic.com/cat";;
declare namespace prod="http://datypic.com/prod";;

/cat:catalog/prod:product/@dept

Note: the attribute is NOT in any namespace..

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
> [email protected]
> Sent: maandag 12 oktober 2009 17:00
> To: Logic, General
> Subject: [MarkLogic Dev General] Some Clarification needed on
> namespaces
>
> Hi
>   If I have a simple file called catalog-ns.xml
>
>   which contains the following elements with namespaces
>   how might I declare a namespace in cq and navigate both the
> catalog and product nodes below using XQuery
>   -- Thanks, Mike
>
>   <catalog xmlns="http://datypic.com/cat";>
>      <product dept="MEN" xmlns="http://datypic.com/prod";>
>         <number>784</number>
>        <name language="en">Cotton Dress Shirt</name>
>         <colorChoices>white gray</colorChoices>
>         <desc>Our <i>favorite</i> shirt</desc>
>     </product>
> </catalog>
>
>

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

Reply via email to