Hi Basex,
My question is about the command XQUERY [query].
Does it work with any XQuery queries or only with XPath?
I tried the following:
<?php
  include("BaseXClient.php");
  // create session
  $session = new Session("localhost", 1984, "admin", "admin");
  $session->execute("open myfirstdatabase");

  echo $session->execute("xquery for $n in //country[name = 'Switzerland'] 
return $n")   ;

  // close session
  $session->close();
?>
This example causes the error: [XPST0003] Incomplete 'window' expression.'
But the following example:
<?php
  include("BaseXClient.php");
  // create session
  $session = new Session("localhost", 1984, "admin", "admin");
  $session->execute("open myfirstdatabase");

  echo $session->execute("xquery //country[name = 'Switzerland']")   ;

  // close session
  $session->close();
?>
is executed without error.
The difference between the two examples is that one uses XQuery and another - 
XPath expression.
Please, tell me whether the command XQUERY can be used with any XQuery queries 
and how exactly?
Thanks & regards,
Tsvetanka
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

Reply via email to