php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57635 Xpath doesn't work with nested open properties
Submitted: 2007-04-25 20:46 UTC Modified: 2017-01-10 08:06 UTC
From: cem@php.net Assigned:
Status: Suspended Package: SCA_SDO (PECL)
PHP Version: 5.2.1 OS: Win32
Private report: No CVE-ID: None
 [2007-04-25 20:46 UTC] cem@php.net
Description:
------------
Get SDO_PropertyNotFoundException when using Xpath to access a nested open property. See Tuscany defect https://issues.apache.org/jira/browse/TUSCANY-988

Reproduce code:
---------------
<?php
$jungle_schema = <<<EOF
<schema xmlns="http://www.w3.org/2001/XMLSchema">
  <element name="jungle">
    <complexType>
      <sequence>
        <any minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
    </complexType>
  </element>
</schema>
EOF;

$bear_schema = <<<EOF
<schema xmlns="http://www.w3.org/2001/XMLSchema">
  <complexType name="bearType">
     <sequence>
       <any minOccurs="0" maxOccurs="unbounded"/>
       <element name= "name" type="string"/>
       <element name= "weight" type="positiveInteger" />
     </sequence>
   </complexType>
</schema>
EOF;

$jungle_file = tempnam(NULL, 'jungle');
file_put_contents($jungle_file, $jungle_schema);
$bear_file = tempnam(NULL, 'bear');
file_put_contents($bear_file, $bear_schema);

$xmldas = SDO_DAS_XML::create(array($jungle_file, $bear_file));
unlink($jungle_file);
unlink($bear_file);

$xmldoc = $xmldas->createDocument();
$jungle = $xmldoc->getRootDataObject();
$mummy = $xmldas->createDataObject(NULL, 'bearType');
$baby = $xmldas->createDataObject(NULL, 'bearType');
$mummy->name = 'Mummy bear';
$mummy->weight = 700;
$baby->name = 'Baby bear';
$baby->weight = 100;

$jungle->bear = $mummy;
$mummy->bear = $baby;

echo $jungle->bear->bear->name;
echo $jungle['bear/bear/name'];

?>


Expected result:
----------------
Baby bear
Baby bear

Actual result:
--------------
Baby bear
Fatal error: Uncaught exception 'SDO_PropertyNotFoundException' with message 'Cannot find property:bear/bear/name' in C:\dev\pecl\sdo\tests\SDO\phpt\tuscany-988.php:48
Stack trace:
#0 C:\dev\pecl\sdo\tests\SDO\phpt\tuscany-988.php(48): unknown()
#1 {main}
  thrown in C:\dev\pecl\sdo\tests\SDO\phpt\tuscany-988.php on line 48


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-10 08:06 UTC] kalle@php.net
-Status: Assigned +Status: Suspended -Assigned To: tuscany 988 +Assigned To:
 [2017-01-10 08:06 UTC] kalle@php.net
Suspending this report as the extension have not had a release for almost 9 years.  Please revive this if the extension once again shows life
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 23:01:29 2024 UTC