All pastes #894672 Raw Edit

Something

public text v1 · immutable
·published 2008-02-07 04:18 UTC
rendered paste body
$w = new SimpleXMLElement($widget['xml']);
  
  // Change any <source> tag URL that may have changed
  $elements = $w->xpath('//source');
  foreach ($elements as $key => $element) {
    if (!empty($element) && isset($url_changes[(string)$element])) {
      $elements[$key] = $url_changes[(string)$element];
    }
  }

// Why does $w->asXML() not reflect that $elements[$key] change?