← Prev in month ← Prev in thread

XPath query and xmlns attribute

From
Ryan Homer <>
To
Date
2007-01-11T13:40:12Z
ID
<>
Thread
XPath query and xmlns attribute
Hi everyone!

I am programming on OS X (Cocoa). I have an NSXMLDocument object with an XML document that looks like the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
.
.
.
</soap:Header>
<soap:Body>
<FindMembershipResponse xmlns="http://www.msn.com/webservices/AddressBook">
<FindMembershipResult>
.
.
.
</FindMembershipResult>
</FindMembershipResponse>
</soap:Body>
</soap:Envelope>


I'm trying to use an XPath query as follows:

//soap:Body/FindMembershipResponse

but it returns no elements. However, it will work if there is no xmlns attribute. Is there something I'm missing in the syntax of the XPath query to accommodate this? I though that the attribute should not matter and should be ignored.

Thanks in advance.




← Prev in month ← Prev in thread