CodeIgniter Forums
Problem with XML - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Problem with XML (/thread-36439.html)

Problem with XML - El Forum - 12-01-2010

In the project i'm currently working on I get the following XML returned:

$response = '
<?xml version="1.0" encoding="UTF-8"?>
<epp >
    <result code="1000">
      <msg>Command completed successfully</msg>
          <domain:name avail="true"></domain:name>

I need the value of the 'avail' attribute, so i make it a DOMXPath object:

$dom = new DOMDocument();
$dom->formatOutput = true;
$responsexPath = new DOMXPath($dom);

And use the following query:
$result = $responsexPath->query('/epp/response/resdata/domain:chkdata/domain:cd/domain:[email protected]');

Without any success =(

What am I doing wrong and what is the right way to get the value of the 'avail' attribute?