Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-18 Thread Kari Cowan
"), "]}") From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Joe Bryan Sent: Tuesday, November 17, 2015 10:42 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] $counter < i -- I might be overthinki

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread David Lee
t;http://www.marklogic.com/> From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher Hamlin Sent: Tuesday, November 17, 2015 12:37 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] $counter < i -- I might be overthinking thi

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Joe Bryan
gt; Reply-To: MarkLogic Developer Discussion mailto:general@developer.marklogic.com>> Date: Tuesday, November 17, 2015 at 1:39 PM To: MarkLogic Developer Discussion mailto:general@developer.marklogic.com>> Subject: Re: [MarkLogic Dev General] $counter < i -- I might be overthinking

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Joe Bryan
-boun...@developer.marklogic.com>> on behalf of Kari Cowan mailto:kco...@alm.com>> Reply-To: MarkLogic Developer Discussion mailto:general@developer.marklogic.com>> Date: Tuesday, November 17, 2015 at 1:18 PM To: MarkLogic Developer Discussion mailto:general@developer.marklog

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Kari Cowan
ot;)), "]}") From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher Hamlin Sent: Tuesday, November 17, 2015 9:37 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] $counter < i -- I might be overthinki

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Christopher Hamlin
json:transform-to-json is returning a document node. fn:concat takes a bunch of things and casts them to xs:string. fn:string-join takes strings specifically. So two possibilities: 1. You need to change the docs to strings before doing string-join. 2. Make sure the strings are in a sequence,

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Kari Cowan
oc($events/doc-uri), $config ), "else count: ", $count, "else counter: ", $counter), "]}") From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher Hamlin Sent: Tuesday, November 17, 2015 5:59 AM To: MarkLo

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Christopher Hamlin
Can fn:string-join help? Join with ',', and glue on whatever you like before or after? On Mon, Nov 16, 2015 at 11:30 PM, Kari Cowan wrote: > Is there any built-in component I can reference that would indicate in the > loop below where $counter is less than the last item in the loop? > > > > Thi

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Geert Josten
r Discussion mailto:general@developer.marklogic.com>> Date: Tuesday, November 17, 2015 at 7:46 AM To: MarkLogic Developer Discussion mailto:general@developer.marklogic.com>> Subject: Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this Cowan, There is a function

Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-16 Thread Indrajeet Verma
Cowan, There is a function fn:last() which returns an integer value that represents the number of items in the current context. Please refer https://docs.marklogic.com/fn:last. See if that works for you. Another approach could be, you can get the count of your results and add the condition like $

[MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-16 Thread Kari Cowan
Is there any built-in component I can reference that would indicate in the loop below where $counter is less than the last item in the loop? This would print the json for the return only when $counter=1, is simple way to know when $counter < LastItem? let $outputJSON:=("{"events":[", let $confi