title: Read value of self-closing tag attribute in PHP with colon separated tagname
body: <p>First post. </p>
  
  <p>Having problems with reading the "file" attribute value in self-closing tag format, example 
  <strong>&lt;foo:bar file=&quot;text.file&quot; /&gt;</strong>. </p>
  
  <p>I can read all the other attribute values in the RSS document in closed tags.</p>
  
  <p>Using the following demo code in reading/updating the attributes "file" value, without success for self-closing tag.</p>
  
  <pre><code>$obj = new DOMDocument();
  $obj-&gt;load('List.rss');
  $i = 0;
  $xpath = new DOMXPath($obj);
  foreach($xpath-&gt;query("//*[name()='foo:bar']") as $attrib)
  {
  if ($i == 1) { //location of the "foo:bar" value to manipulate..
      echo $attrib-&gt;nodeName; //prints foo:bar OK
      echo $attrib-&gt;nodeValue; //prints empty string
      $attrib-&gt;nodeValue = '?yes'; //attempt to update attribute value
  }
  $i++;
  }
  </code></pre>
  
  <p></p>
  
  <p>The $attrib->nodeValue = '?yes'; assignment updates the node with <strong>&lt;foo:bar file=&quot;text.file&quot; /&gt;?yes&lt;/foo:bar &gt;</strong>, not compatible with the required RSS format.</p>
  
  <p>What I need is to update <strong>&lt;foo:bar file=&quot;text.file&quot; /&gt;</strong> with <strong>&lt;foo:bar file=&quot;text.file?yes&quot; /&gt;</strong>, basically adding a querystring on-the-fly without adding closing tags.</p>
  
  <p>Cheers</p>