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..
Kind regards, Geert > drs. G.P.H. (Geert) Josten Consultant Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 mailto:[email protected] http://www.daidalos.nl/ KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Andrew Welch > Sent: dinsdag 16 februari 2010 12:18 > To: General Mark Logic Developer Discussion > Subject: [MarkLogic Dev General] on-modify trigger that > modifies the xml > > Hi, > > I have a trigger that fires on document modify, which itself > modifies the xml (adds lat and long attributes to e:gpe > elements) which then seems to fire the trigger again, for > each individual modification... > often causing max trigger depth to be exceeded. > > If I change the trigger to be on create, the trigger is > executed just the once, but then if a newer file is inserted > over the old one, it doesn't fire. > > What is the correct approach when you need some query to run > on document modify, but that query modifies the document? > > > thanks > -- > Andrew Welch > http://andrewjwelch.com > Kernow: http://kernowforsaxon.sf.net/ > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
