}
# remove all the <fragment> tags
-
for ($i = 0; $i < $node->childNodes->length; ++$i) {
$child = $node->childNodes->item($i);
if ($child->localName != 'temporary-fragment') {
continue;
}
- for ($j = 0; $j < $child->childNodes->length; ++$j) {
- $child2 = $child->childNodes->item($j);
+ while ($child->childNodes->length > 0) {
+ $child2 = $child->childNodes->item(0);
$node->appendChild($child2);
}
+ --$i;
$node->removeChild($child);
}
}