Shorter version of my question: is there a file-system equivalent of the fn:doc-available function?

Eric

Eric Palmitesta wrote:
Hi all,

Hopefully I'm missing something and someone can put me on the right track.

It's fine to say "if (exists(doc('blah'))) then" because doc will simply return () rather than producing an error. How do I do the same with xdmp:document-get? Since xdmp:document-get errors with "file not found" (if a file is indeed not found), I was hoping to check if the call will fail before I make it. The xdmp:uri-is-file function looks like the wrong one to use, though, because an absolute path means something different:

The api for xdmp:document-get says
"On the filesystem, the path can be fully qualifed or relative. Relative pathnames are resolved from the directory in which MarkLogic Server is installed."

The api for xdmp:uri-is-file says
says "If the URI begins with a '/', it is relative to the root directory of the application server."

Is a try/catch the only way?

Thanks,

Eric
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to