Re: [MarkLogic Dev General] Why does xs:boolean(())=()?

2011-06-17 Thread Keith L. Breinholt
Your function was never called. You have been bitten by function mapping. Passing a () value to any function with function mapping turned on doesn't call the function at all. Function mapping is turned on by default. If you want it off put this at the top of your code. declare optio

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Mike Sokolov
oops - missed the alternate thread on this topic... On 06/17/2011 02:39 PM, Mike Sokolov wrote: Also completely culture-dependent. Whose holidays are we talking about? Did you take off Patriot's Day? It's a state holiday here in Massachusetts, observed only by state employees and people who

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Mike Sokolov
Also completely culture-dependent. Whose holidays are we talking about? Did you take off Patriot's Day? It's a state holiday here in Massachusetts, observed only by state employees and people who want to watch the marathon. Perhaps you would need a map from person->locale->holiday map. You

Re: [MarkLogic Dev General] Why does xs:boolean(())=()?

2011-06-17 Thread G. Ken Holman
At 2011-06-17 17:58 +, Will Thompson wrote: >Can someone explain why passing this function () returns (), instead >of an element or throwing an exception? > >declare function local:do-stuff( > $bool as xs:boolean >) as element() { > if ($bool) > then > else >}; I

Re: [MarkLogic Dev General] Why does xs:boolean(())=()?

2011-06-17 Thread Danny Sokolsky
If you want to turn it off, you can do so in the prolog of the main module: declare option xdmp:mapping "false"; It can be very useful at times, though.some people love it, so people don't -Danny -Original Message- From: general-boun...@developer.marklogic.com [mailto:genera

Re: [MarkLogic Dev General] Why does xs:boolean(())=()?

2011-06-17 Thread Will Thompson
Ah, that makes sense. Scary. Thanks Danny. -W -Original Message- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky Sent: Friday, June 17, 2011 1:05 PM To: General MarkLogic Developer Discussion Subject: Re: [MarkL

Re: [MarkLogic Dev General] Viewing Documents with WebDAV

2011-06-17 Thread Tim Meagher
Hi Walter, My XP Pro and Windows 7 WebDAV clients both fail to work properly. I gave up on trying to fix them, but thanks anyhow for the info! I currently use EnginSite DataFreeway for uploading and replacing xquery modules without any problem. I would use BitKinex, but it has a weird

Re: [MarkLogic Dev General] Viewing Documents with WebDAV

2011-06-17 Thread Tim Meagher
Hi Danny, I think that last-modified is enabled by default. I haven't tried to disable it to improve performance, but I can't say I have a good feel for all of the ramifications for doing so. Regardless of the state of last-modified, I understand the problem of browsing a huge directory in

Re: [MarkLogic Dev General] Why does xs:boolean(())=()?

2011-06-17 Thread Danny Sokolsky
Looks like function mapping to me. You are running the function 0 times, so it returns empty. http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/xquery/enhanced.xml%2355459 -Danny -Original Message- From: general-boun...@developer.marklogic.com [mailt

[MarkLogic Dev General] Why does xs:boolean(())=()?

2011-06-17 Thread Will Thompson
Can someone explain why passing this function () returns (), instead of an element or throwing an exception? declare function local:do-stuff( $bool as xs:boolean ) as element() { if ($bool) then else }; I see that xs:boolean(())=(), but it seems like this shou

Re: [MarkLogic Dev General] Viewing Documents with WebDAV

2011-06-17 Thread Walter Underwood
If your WebDAV client is Windows, make sure you are up-to-date. Microsoft has two different implementations of WebDAV and each has a somewhat rocky history of bugs. Wikipedia tries to make sense of it: http://en.wikipedia.org/wiki/WebDAV#Microsoft_Windows Here is a good summary of the known bu

Re: [MarkLogic Dev General] Viewing Documents with WebDAV

2011-06-17 Thread Danny Sokolsky
Hi Tim, There is nothing inherently slow about WebDAV per se, but as I see it, there are 2 issues that people tend to run up against: 1) Scale: WebDAV requires last-modified to be enabled, which in turn creates properties fragments on each document in the database. This tends to be fin

[MarkLogic Dev General] Calling Javascript from Xquery

2011-06-17 Thread Randy Smith
Basic question here for something new to me: I have an app that is intended to: - Do an xquery in an .xqy app, grab part of the result, then send the result part to a .js module, to eventually be sent to an Excel spreadsheet using the MarkLogic plug-ins. - When I get the results back (whi

Re: [MarkLogic Dev General] Viewing Documents with WebDAV

2011-06-17 Thread Tim Meagher
Hi Folks, I haven't had any response to this yet - did I hit a nerve? J My experience with WebDAV and MarkLogic has been interesting. There are things I know cause problems, such as trying to move or rename a directory URI. It makes me wonder if there are some WebDAV commands that should

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Damon Feldman
So true! But you need the holidays, in some format, if you are going to exclude them. No getting around that. Damon From: general-boun...@developer.marklogic.com [general-boun...@developer.marklogic.com] On Behalf Of Geert Josten [geert.jos...@daidal

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Geert Josten
Don't forget religion! ;-) Kind regards, Geert -Oorspronkelijk bericht- Van: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] Namens Tim Finney Verzonden: vrijdag 17 juni 2011 15:44 Aan: general@developer.marklogic.com Onderwerp: Re: [MarkLogic Dev

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Tim Finney
Then there is the variability across jurisdiction, social status, and date of what days are holidays and whether Saturdays and Sundays are working days. Best, Tim Finney On Fri, 2011-06-17 at 06:38 -0700, general-requ...@developer.marklogic.com wrote: > From: Geert Josten > Subject: Re: [MarkLo

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Geert Josten
Entering the holidays of a few centuries is a lot of typing.. ;-) Kind regards, Geert Van: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] Namens Damon Feldman Verzonden: vrijdag 17 juni 2011 15:28 Aan: General MarkLogic Developer Discussion Onderwerp: Re

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Damon Feldman
Since you only need the count of holidays in some date range in order to subtract it, store the holidays somewhwere and count them up. I imagine the total holidays for a period of a few hundred years will only be a few thousand dates. This could be stored in a sequence as a server-field. Linea

Re: [MarkLogic Dev General] Net Working Days calculation?

2011-06-17 Thread Geert Josten
Hi Jason, That was my initial thought as well. Such calculation would scale much better. Here the more scalable approach: import module namespace functx = "http://www.functx.com"; at "/MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy"; let $weekdays := ("su", "mo", "tu", "we", "th", "fr", "sa")