|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57553 Testing for existing xml elements fails
Submitted: 2007-03-01 09:59 UTC Modified: 2017-01-10 08:05 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cdouglas at securustech dot net Assigned:
Status: Suspended Package: SCA_SDO (PECL)
PHP Version: 5.2.1 OS: RHEL 4 U2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: cdouglas at securustech dot net
New email:
PHP Version: OS:


 [2007-03-01 09:59 UTC] cdouglas at securustech dot net
I have an application where I am loading an XSD into the XML DAS and loading an XML file.  I am then trying to determine if an element of the XML file exists using isset with xpath path.  I am seeing that true is always returned, even when it doesn't exist. 

Reproduce code:
<site id ='12345'>
<extendedData dataType='name'>South Central</extendedData>
<extendedData dataType='timezone'>US/Central</extendedData>
<site id='23456'>

load xml into $doc


Expected result:
statement returns false

Actual result:
statement returns true


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-10 13:14 UTC] simonslaws at googlemail dot com
What is happening here is that SDO is raising an index out of bounds exception in trying to process dataType='blah' because the list index doesn't exist. SDO has to differentiate between  properties that don't exist and properties that exist but are set to null. Hence exceptions are called on to help out. 

Throwing exceptions inside isset() seems to make it return true which is a little strange but having said that I'm not sure what the right answer is other than catching the exception and ignoring what isset() returns. If noting else we need to improve the documentation aboutthe expected results of indexing properties that might or might not exist.

Chris has susequently posted a work round he has found to work in his situation (
 [2007-04-27 08:07 UTC]
There are quite a few peculiarities here, so I'm starting at the top with the problem that Tuscany is returning false positives to isset when a xpath ends with a list index. Most of the other inconsistencies hinge on this behaviour. See
 [2017-01-10 08:05 UTC]
-Status: Assigned +Status: Suspended -Assigned To: tuscany 1236 +Assigned To:
 [2017-01-10 08:05 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: Sun Jun 16 03:01:28 2024 UTC