|  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: Assigned:
Status: Suspended Package: SCA_SDO (PECL)
PHP Version: 5.2.1 OS: Win32
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-04-25 20:46 UTC]
Get SDO_PropertyNotFoundException when using Xpath to access a nested open property. See Tuscany defect

Reproduce code:
$jungle_schema = <<<EOF
<schema xmlns="">
  <element name="jungle">
        <any minOccurs="0" maxOccurs="unbounded"/>

$bear_schema = <<<EOF
<schema xmlns="">
  <complexType name="bearType">
       <any minOccurs="0" maxOccurs="unbounded"/>
       <element name= "name" type="string"/>
       <element name= "weight" type="positiveInteger" />

$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));

$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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-10 08:06 UTC]
-Status: Assigned +Status: Suspended -Assigned To: tuscany 988 +Assigned To:
 [2017-01-10 08:06 UTC]
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: Tue Jun 25 11:01:32 2024 UTC