Yup that works Great... Just 1 follow up say I have an xml file (product-ns.xml) I'd like to load into XML datastore with the prod namespace defined Is there a way to do that?
<prod:product dept="MEN" xmlns="http://datypic.com/prod"> <prod:number>563</number> <prod:name language="en">Floppy Sun Hat</name> </prod:product> Then Through a document load , load it xdmp:document-load("c:\Program Files\MarkLogic\TestXQuery\product-ns.xml", <options xmlns="xdmp:document-load"> <uri>product-ns.xml</uri> <format>xml</format> </options>) -- Thanks, Mike ----- Original Message ----- From: "Geert Josten" <[email protected]> To: "General Mark Logic Developer Discussion" <[email protected]> Sent: Monday, October 12, 2009 11:04:47 AM GMT -05:00 US/Canada Eastern Subject: RE: [MarkLogic Dev General] Some Clarification needed on namespaces 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
_______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
