You can start getting fancy with functions like $x//*:mine[fn:namespace-uri(.) eq '']
----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected] Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com<http://www.marklogic.com/> From: [email protected] [mailto:[email protected]] On Behalf Of William Merritt Sawyer Sent: Thursday, October 25, 2012 1:24 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Declare default element namespace Is there any way to declare a namespace that is equal to the empty namespace so you can then use it in a xpath? Errors on empty string declare namespace empty = ""; /empty:some-element From: [email protected] [mailto:[email protected]] On Behalf Of David Lee Sent: Thursday, October 25, 2012 11:21 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Declare default element namespace Take that back, its a pain but try this: Its not *exactly* what you want but sometimes works. *:name resolves to all namespaces including the empty one. xquery version "1.0-ml"; declare default element namespace "http://www.w3.org/1999/xhtml"; let $x := <body><mine xmlns="">No NS></mine><p>hello world</p></body> return $x//*:mine ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected]<mailto:[email protected]> Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com<http://www.marklogic.com/> From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of David Lee Sent: Thursday, October 25, 2012 1:17 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Declare default element namespace Not to my knowledge.. I opened a W3C XQuery feature request for this a while back ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected]<mailto:[email protected]> Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com<http://www.marklogic.com/> From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of William Merritt Sawyer Sent: Thursday, October 25, 2012 1:10 PM To: [email protected]<mailto:[email protected]> Subject: [MarkLogic Dev General] Declare default element namespace If you set the default element namespace with "declare default element namespace 'some-url'; " is there a way still xpath against the empty namespace? Thanks, - Will
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
