Hi,
In MarkLogic 5 the function xdmp:invoke has received an option named
static-check that will perform a validation instead of an actual
evaluation. My use case is that I'm editing such an XQuery module opened
from the server and I want to validate it but without having to save it
first. I'm
xdmp:eval has the static-check option too. You could send the module to it as a
string.
Beyond that, the Modules database makes a dandy persistent uri-content
repository. You could have a hierarchy of temp files, perhaps something like
/sync.ro/.sessions/{$SESSION}/{$RELATIVE-PATH}. Use a
Hi,
Unfortunately if a query is submitted through xdmp:eval you can't give a
base URI for resolving any relative imports that that query might have.
Or can you? So I kind of require a mix between xdmp:invoke and
xdmp:eval. The module URI-updated module content mapping to be
passed to the
To resolve imports via xdmp:eval, set the 'root' option - just as you would do
to invoke a module. Take a look at how cq does it. The code is Apache-licensed.
If the imports aren't available on the server at all, you will have to make
them available. That is where the Modules database might
We have a system with a million or so records. When attempting to discern
if a doc with a given uri is in the system, what's the fastest method?
Thanks.
___
General mailing list
General@developer.marklogic.com
xdmp:exists(fn:doc(/my/uri.xml))
will be fast.
The uri lexicon functions are also a good choice.
-Danny
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of David Swearingen
Sent: Thursday, March 01, 2012 1:15 PM
To:
It looks to me like doc-available($uri) is equivalent to xdmp:exists(doc($uri))
now. Either expression results in a simple list-cache lookup, with no tree
fetches and no reliable difference in elapsed-time.
If you use a uri lexicon, probably something like exists(cts:uris($uri,
'limit=1'))
I am finding cts:element-query has an optional third parameter but I am finding
no documentation mentioning it. Can anyone tell me what this third parameter
is and purpose?
Thanks,
- Will
NOTICE: This email message is for the sole use of the intended recipient(s)
and may contain
I think one advantage xdmp:exists has is that you can put any searchable XPath
xpression in there. So if you wanted it to return true only if a document had
a particular element, for example, then you can do something like this:
xdmp:exists(fn:doc(/my/uri.xml)/foo)
So it depends if all you
I am not positive, but I think the 3rd param is for options, but there are no
options to cts:element-query, so it there is no documentation for it.
-Danny
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of William Merritt
Sawyer
Sent:
So I am finding it has options and it does something. Adding the self option
limited the cts:element-query to only match root image nodes. I would be
interested in what other options it supports.
- Will
Example Query
xquery version 1.0-ml;
let $element := 'image'
let $uris1 :=
/general/attachments/20120301/4f2ff09a/attachment-0001.html
--
Message: 2
Date: Thu, 1 Mar 2012 13:25:25 -0800
From: Danny Sokolsky danny.sokol...@marklogic.com
Subject: Re: [MarkLogic Dev General] Is fn:doc-available() high
performance, or should we use
Hi,
Thank you for taking the time to think about my problem. I am aware of
the 'root' option but there are some cases where it can't help me. For
example let's assume my modules root is '/code' and I open a module with
the URI '/code/a/main.xqy'. This module has an import relative to that
URI
13 matches
Mail list logo