You are here

function atomrdf_parser_parse in Feeds Atom 6

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

Parse the feed into a data structure.

Parameters

$feed: The feed object (contains the URL or the parsed XML structure.

Return value

stdClass The structured datas extracted from the feed.

1 call to atomrdf_parser_parse()
FeedsAtomRDFParser::parse in plugins/FeedsAtomRDFParser.inc
Implementation of FeedsParser::parse().

File

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

Code

function atomrdf_parser_parse($string) {
  @($xml = simplexml_load_string($string, NULL, LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_NOCDATA));

  // Got a malformed XML.
  if ($xml === FALSE || is_null($xml)) {
    return FALSE;
  }
  $feed_type = atomrdf_format_detect($xml);
  if ($feed_type == "atom1.0") {
    return atomrdf_parse($xml, $string);
  }
  return FALSE;
}