Hi Christian, I had myself wondered if there is a database secretly involved. So I had checked that - there is no such database. Today I have already exploited the feature in serious, writing the query below, which does a little more than counting: it extracts data and composes a result document from those contents. Kind regards,Hans-Jürgen PS: Here der nächste Streich: declare namespace f="http://www.parsqube.de/ns/xquery-functions"; declare variable $infile external := 'wiki-sample.xml';
declare function f:filePath($n) { ( let $fullNumber := format-number($n, '0000000') for $i in 1 to 7 return substring($fullNumber, $i, 1) ) => string-join('/') || '.xml' };
prof:time( <wiki>{ for $page at $pos in doc($infile)/*/page return <page>{ <url>{f:filePath($pos)}</url>, $page/title }</page> }</wiki>)
Am Montag, 12. April 2021, 12:22:59 MESZ hat Christian Grün christian.gruen@gmail.com Folgendes geschrieben:
Hi Hans-Jürgen,
A streaming fn:doc?
I need to check the code ;)
Have you possibly created a database for that document in the past? If so, the database will be opened instead of the local file.
Best, Christian
On Fri, Apr 9, 2021 at 8:54 PM Hans-Juergen Rennau hrennau@yahoo.de wrote:
Hello, I would like to let you know that just as there is matter and anti matter, there are bugs and anti bugs. An anti bug is when something works which cannot possibly work. I am not surprised that the first anti bug detected (by me) is a BaseX one.
The following invocation
basex "doc('result.xml')/*/page/id => distinct-values() => sort()"
processes a file the size of which is more than 8 GB. It cannot be processed on my machine, unless processing is streaming. A streaming fn:doc? Amazing. (At least me.)
Hans-Jürgen