title: PHP5 and DOM changing XML node attribute value
body: <p>Having the next XML(Idatzi.xml) :</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='ISO-8859-1'?&gt;
  &lt;!DOCTYPE markables SYSTEM "markables.dtd"&gt;
  &lt;markables&gt;
  &lt;markable id="markable_1" atrib="yes" span="word_1..word_4"&gt; &lt;/markable&gt;
  &lt;markable id="markable_2" atrib="no" span="word_6..word_7"&gt; &lt;/markable&gt;
  &lt;markable id="markable_3" atrib="yes" span="word_10..word_24"&gt; &lt;/markable&gt;
  &lt;/markables&gt;
  </code></pre>
  
  <p>And the next PHP code:</p>
  
  <pre><code>&lt;?php
  
  $xmlIdatziDok = new DOMDocument();
  if($xmlIdatziDok-&gt;load("Idatzi.xml") === FALSE){die('Error');}
  $xPath_IdatziDok = new DOMXPath($xmlIdatziDok);
  
  foreach ($xPath_IdatziDok-&gt;query('//markables/markable') AS $Idaztekoa)
  {
    $IdaztekoaID = $Idaztekoa-&gt;getAttribute('id');
    $IdaztekoaAtrib = $Idaztekoa-&gt;getAttribute('atrib');
  
      if($IdaztekoaAtrib != "yes")
      {
        $Idazteko-&gt;Attribute('atrib') = "yes";      
      }
  }
  </code></pre>
  
  <p>I would like to know how to correctly write the next line of code in the PHP code:</p>
  
  <pre><code>$Idazteko-&gt;Attribute('atrib') = "yes";
  </code></pre>
  
  <p>It is obviously wrong written. What I would like to do is to change the "no" of markable_2 to "yes". Any idea?</p>