Hi,

I intensively use both. So yes it is possible 

here is an example:

        case "get_projects":
            $xquery = "XQUERY "
                    . "for \$meetingsActors in //meeting/actors/userlink[@uid='$userId'], "
                    . " \$projects in //project "
                    . " where \$meetingsActors/../../@prID = \$projects/@id "
                    . " return \$projects ";
            $projectActorsMeetingActor = $session->execute($xquery);

            $contentFull = "<MN>)<actor>$projectActorsMeetingActor</actor></MN>";
            echo $contentFull;
            break;

Cordialement / Best Regards,

Yoann Maingon
Minerva France

+33 6 64 32 49 66

Download Aras Innovator - Téléchargez Aras Innovator



2013/12/2 Tsvetanka Georgieva-Trifonova <cvetygeorg@yahoo.com>
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