1 Reply Latest reply: Mar 4, 2011 5:26 AM by 829964 RSS

    Extrange behaviour when calling db xml from php

    829964
      Hi,
      I am running dbxml 2.5.16 (binary version) on Windows with Apache 2.2 and PHP 2.5.2. In the pasts, the following php pages worked, but now it seems it cannot execute the query (it works fine until the $result = $mgr->query() line, when execution stops...

      Any idea?

      <?php
      header('Content-Type: application/xml');
      $mgr = new XmlManager(null);
      $con = $mgr->openContainer("c:\EJEMPLO.dbxml");
      $qc = $mgr->createQueryContext();
      $qc->setDefaultCollection("EJEMPLO.dbxml");
      $qc->setNamespace("post", "urn:isbn:2-933366-22-9");
      $query = "collection()/post:data[/post:name='Barcelona']";
      $results = $mgr->query($query, $qc);
      $results->reset();
      while($results->hasNext())
      {
      $val = $results->next();
      $doc = $val->asDocument();

      $xmlDecl = "<?xml version='1.0' encoding='UTF-8' ?>";
      echo $xmlDecl;
      $xml.=$val->asString();
      echo($xml);

      }
      ?>

      thanks in advance.