Question

I want to extract the href (value 3FEDA37BCEEEB8B33FDD3B9C39FBF1CC) attribute from <conferencereport> tags. Currently there are two tags with this name which can be increase.

Please provide the logic to extract these values.

<conferencereportlist xml:base="" xlink:href="ConferenceReportList" xlink:type="simple" dir="asc" sort="ConferenceName" total="2"     results="2" startindex="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.avistar.com/webapi/2008/namespace">
  <conferencereport xlink:type="simple" xlink:href="conferenceReports/3FEDA37BCEEEB8B33FDD3B9C39FBF1CC">
    <conferencename>Trial Meeting Room</conferencename>
    <conferenceaddress></conferenceaddress>
    <mediaprocessorhost>WIN-1A91T1BLDKV</mediaprocessorhost>
    <starttime>05/06/2014 08:28:16 AM GMT</starttime>
    <duration>250616</duration>
    <participants>2</participants>
  </conferencereport>
  <conferencereport xlink:type="simple" xlink:href="conferenceReports/3FC55B1FFC91A2AC3FD3D7A0C3CD0EB2">
    <conferencename>Trial Meeting Room</conferencename>
    <conferenceaddress></conferenceaddress>
    <mediaprocessorhost>WIN-1A91T1BLDKV</mediaprocessorhost>
    <starttime>05/06/2014 08:42:45 AM GMT</starttime>
    <duration>602453</duration>
    <participants>1</participants>
  </conferencereport>
</conferencereportlist>
Was it helpful?

Solution

Did you try to use DOMElement::getAttribute => DOMELEMENT.

$href = $node->getElementsByTagName('myLink')->item(0)->getAttribute('href');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top