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


Am 22.07.2016 23:17 schrieb "George Sofianos" <gsf.greece@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!