[MarkLogic Dev General] Identical namespace prefixes don't match?
Ron Hitchens
ron at ronsoft.com
Wed Jun 30 10:16:27 PDT 2010
If I do this on ML 4.1-6:
xdmp:document-insert ("/foo.xml",
<foo xmlns:m="mynamespace"><bar>blah</bar></foo>)
Then fn:doc ("/foo.xml") shows this:
<foo xmlns:m="mynamespace"><bar>blah</bar></foo>
But if I run this XQuery, I get an empty sequence:
declare namespace m = "mynamespace";
fn:doc ("/foo.xml")/m:foo
Wildcarding the namespace returns the element:
declare namespace m = "mynamespace";
fn:doc ("/foo.xml")/*:foo
=> <foo xmlns:m="mynamespace"><bar>blah</bar></foo>
If I insert the doc without using a prefix in the
document's xmlns declaration, then it works as expected:
xdmp:document-insert ("/foo.xml",
<foo xmlns="mynamespace"><bar>blah</bar></foo>)
declare namespace m = "mynamespace";
fn:doc("/foo.xml")/m:foo
=> <foo xmlns="mynamespace"><bar>blah</bar></foo>
Why doesn't the first case match? Am I missing
something?
---
Ron Hitchens {mailto:ron at ronsoft.com} Ronsoft Technologies
(650) 766-2355 (Home Office) http://www.ronsoft.com
(707) 924-3878 (fax) Bit Twiddling At Its Finest
"No amount of belief establishes any fact." -Unknown
More information about the General
mailing list