I was going to add that //*:foo won't leverage the indexes (another reason
not to use it when querying across the database), but it looks like that's
not true anymore. It looks like the local name and namespace URI are
separately indexed now, which is great!

I see that this:

xdmp:plan(//*:foo)

filters out documents without any <foo> elements, regardless of namespace.

And even better, that this:

xdmp:plan(//xyz:*)

filters out documents that don't have any elements in the given namespace.

Does anyone know when this was added? All I know for sure is that it works
in MarkLogic 8 and not in 4.2 :-)

Evan

P.S. Hi, everybody! Long time no see!


On Thu, Dec 3, 2015 at 11:51 AM, David Lee <[email protected]> wrote:

> Thanks that works.  So, the * is saying any namespace.
>
>
>
> Yes,   (as of XPath 2.0)
>
> /element  == element in no namepace
>
> /*:element == element in any namepace
>
>
>
> Very useful for quick 'one off's when you dont want to bother with the
> neamespace decl,
>
> but its a bad habbit to get into for production code -- you can end up
> selecting elements in unexpected places
>
> that you didnt intend.
>
>
>
>
>
>
> -----------------------------------------------------------------------------
>
> David Lee
> Lead Engineer
> *Mark**Logic* Corporation
> [email protected]
> Phone: +1 812-482-5224
>
> Cell:  +1 812-630-7622
> www.marklogic.com
>
>
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to