Hi,

 

Hope you can help a very novice basex/xquery user!

 

I have the following query to get the complete XML of the “Links.xml” document in the “project” collection.

 

for $doc in collection(‘project’) where matches(document-uri($doc), '^Links.xml') return $doc

 

When running this command in basex on linux it completes in around 2.5 seconds (acceptable speed given the size of the XML file) but when I run it via PHP using the client from the website, it takes around 15 seconds:

 

$session = new Session("localhost", $host, $username, $password);

$input = "for \$doc in collection('project') where matches(document-uri(\$doc), '^Links.xml') return \$doc";

$query = $session->query($input);

$xml = $query->execute();

 

Any idea why it might take so long, or whether rewriting my query in a different way would speed up the response?

 

Thanks,

Jon.