Hi Geert,

On 16 February 2010 11:22, Geert Josten <geert.jos...@daidalos.nl> wrote:
> Hi Andrew,
>
> If your trigger is meant to update your document, then you don't have much 
> options I guess. But I would say that it shouldn't be difficult to test for 
> the presence of those attributes before adding them, preventing unnecessary 
> subsequent updates..
>

Yes, we only modify <e:gpe> elements that don't have those attributes,
and also remove the markup for any values that don't return coords
from google's geocoder (caching known good values locally etc)... so
the number of modifications should decrease by 1 each time around....

However, I've recently also added some code to remove the markup for
entities that we don't use, such as numbers, urls, titles, emails etc
so I guess that's adding additional modification events which is
causing a lot more frequent trigger depth exceeded exceptions:

let $numbers := for $n in $doc//e:number return xdmp:node-replace($n, $n/text())
let $urls := for $n in $doc//e:url return xdmp:node-replace($n, $n/text())
let $titles := for $n in $doc//e:title return xdmp:node-replace($n, $n/text())
let $nationalities := for $n in $doc//e:nationality return
xdmp:node-replace($n, $n/text())
let $times := for $n in $doc//e:time return xdmp:node-replace($n, $n/text())
let $distance := for $n in $doc//e:distance return
xdmp:node-replace($n, $n/text())
....

Would using separate transactions for each of those help?

Am I even going about this the right way...?  It's not possible to
supply an options node to entity:enrich to configure what gets marked
up, so I've added this step to fix it retrospectively.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
_______________________________________________
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general

Reply via email to