On 28 Feb, 17:19, "cdouglas" <[EMAIL PROTECTED]> wrote:
> 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.  I don't know if
> I am doing something wrong, this not supported, or there is a bug.
> Here is a sample if what I am doing:
> <sites>
> <site id ='12345'>
> <extendedData dataType='name'>South Central</extendedData>
> <extendedData dataType='timezone'>US/Central</extendedData>
> </site>
> <site id='23456'>
> </site>
> </sites>
> -----
> load xml into $doc
> isset($doc["site[id='12345']/extendedData[dataType='name']"]) should
> return true and does
> isset($doc["site[id='12345']/extendedData[dataType='blah']"]) should
> return false and returns true.
> I am wondering if its not looking at the values in the brackets to do
> that matching.
> Thanks
> Chris

Hi Chris

I've come across slightly strange behaviour in this area before
74bb0f4b994c9fcd/?hl=en#). I tried your example and isset returns true
in both cases for me also which doesn't sound right. However what it's
actually trying to do behind the scenes is throw an index out of
bounds exception in the second case so  maybe this is what is having a
detrimental impact on isset. Can you raise a bug report for this so
that we go and take a look at it. In the mean time you could reorg
your code a little to catch exceptions on these tests and hence find
the cases where the elements are not present.

As an aside. Is your id a string type? If so no problem. In my test I
made it an integer as you have used numbers and the xpath processing
expects id=12345 rather than id='12345' in this case.

I'm out on leave for a day or so now but, judging by the previous post
I reference, Caroline has the history of this behaviour in her head so
can probably further advise if required.



You received this message because you are subscribed to the Google Groups 
"phpsoa" group.
To post to this group, send email to phpsoa@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to