discard-document equivalent

Friday, 22 July 2016 · 2 messages · last reply 23 Jul 2016
GS
George Sofianos22 Jul 2016 23:16 #
Hi again, I wonder if there is an equivalent command to discard-document which is available in Saxon PE? I have a list of XML documents available in a remote repository, and I make the same checks in every XML in a for loop. Example:
let $list := ("http://url1", "http://url2", "http://url3", "http://url4")

for $file in $list
return local:runChecks(doc($file)) If the documents are large, they will keep filling the memory. I just run a script that uses 42 files about 50mb each, and that consumed over 2GB of memory. The checks are quite complex so I don't think that the fetch module would work here, if my understanding is correct about what it does. For more information about how discard-document works, see my question/answer on SO: http://stackoverflow.com/questions/34514859/using-discard-document-with-saxon-and-xquery/34516641#34516641 Thanks!
CG
Christian Grün23 Jul 2016 08:31 #
Hi George, I would indeed have recommended our Fetch Module for that task. Could you detail why you think it might not suit here? Cheers Christian
Quoted text · George Sofianos · 24 lines
Am 22.07.2016 23:17 schrieb "George Sofianos" <gsf.greece at gmail.com>: > Hi again, I wonder if there is an equivalent command to discard-document > which is available in Saxon PE? I have a list of XML documents available in > a remote repository, and I make the same checks in every XML in a for loop. > > Example: > > let $list := ("http://url1", "http://url2", "http://url3", "http://url4") > > for $file in $list > > return local:runChecks(doc($file)) > > If the documents are large, they will keep filling the memory. I just run > a script that uses 42 files about 50mb each, and that consumed over 2GB of > memory. The checks are quite complex so I don't think that the fetch module > would work here, if my understanding is correct about what it does. For > more information about how discard-document works, see my question/answer > on SO: > http://stackoverflow.com/questions/34514859/using-discard-document-with-saxon-and-xquery/34516641#34516641 > > Thanks! > >

⚡Generated with XQuery