In the first case, the foo element isn't in the "mynamespace" namespace. You've
bound the "m" prefix to that namespace, but foo is in the empty namespace.
In the second case, "mynamespace" is the default element namespace, so foo is
in the "mynamespace" namespace.
To make the first case work, you'd need to do:
xdmp:document-insert ("/foo.xml",
<m:foo xmlns:m="mynamespace"><bar>blah</bar></m:foo>)
Aaron
________________________________
From: [email protected]
[[email protected]] On Behalf Of Ron Hitchens
[[email protected]]
Sent: Wednesday, June 30, 2010 1:16 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] Identical namespace prefixes don't match?
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:[email protected]} Ronsoft Technologies
(650) 766-2355 (Home Office)
http://www.ronsoft.com<http://www.ronsoft.com/>
(707) 924-3878 (fax) Bit Twiddling At Its Finest
"No amount of belief establishes any fact." -Unknown
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general