XML : Fetch value from XML Object?

I need to fetch the value of "joinmeetingurl" element from the xml. I tried in following way. But it returns nothing. Please help me to fetch the value.

  <?php     $xml = '<serv:message xmlns:serv="http://www.webex.com/schemas/2002/06/service"          xmlns:com="http://www.webex.com/schemas/2002/06/common"          xmlns:meet="http://www.webex.com/schemas/2002/06/service/meeting"          xmlns:att="http://www.webex.com/schemas/2002/06/service/attendee">            <serv:header>              <serv:response>                <serv:result>SUCCESS</serv:result>                  <serv:gsbstatus>PRIMARY</serv:gsbstatus>              </serv:response>            </serv:header>            <serv:body>              <serv:bodycontent xsi:type="meet:getjoinurlMeetingResponse"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                <meet:joinmeetingurl>meetingURL</meet:joinmeetingurl>             </serv:bodycontent>          </serv:body>         </serv:message>';      $xml = simplexml_load_string($xml);    $items = $xml->registerXPathNamespace('meet','http://www.webex.com/schemas/2002/06/service/meeting');      $resp = $xml->xpath('//meet:joinmeetingurl');    ?>    

Im getting empty value for $resp always.

No comments:

Post a Comment