You are here

function atomrdf_bulk_copy in Feeds Atom 6

Same name and namespace in other branches
  1. 7 libraries/atomrdf_parser.inc \atomrdf_bulk_copy()

File

libraries/atomrdf_parser.inc, line 397
Contains the atomrd parsing functions.

Code

function atomrdf_bulk_copy($xml) {
  if ($xml) {
    $count = 0;
    $valid_count = 0;
    $blob = array();
    foreach ($xml
      ->children() as $xml_child) {
      $count = $count + 1;
      $key = $xml_child
        ->getName();
      $value = atomrdf_bulk_copy($xml_child);
      if ($key) {
        $blob[$key] = $value;
        $valid_count = $valid_count + 1;
      }
    }
    if ($count > 0) {
      if ($valid_count > 0) {
        return $blob;
      }
    }
    else {
      return "{$xml}";
    }
  }
  return NULL;
}