Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Is there a module that supports NewsML the same way Feeds supports other formats?

share|improve this question
2  
I can't find anything but there is some good discussion around it here groups.drupal.org/node/9758 – Jeremy French Aug 10 '11 at 9:17
OK, thank you for your reply! – Jane Aug 10 '11 at 9:29
@Jeremy French Maybe that should be posted as answer, if nobody can point out an existing module. – kiamlaluno Aug 10 '11 at 12:07

1 Answer

You can use XPATH, and built your custom module.

$xml = simplexml_load_file($xmlfile);    
$stories = $xml->xpath('/NewsML/NewsItem/NewsComponent');

foreach ($stories as $story) {
  $headlineItem = $story->xpath('NewsComponent/NewsComponent/ContentItem/DataContent/nitf/path/path');
  // …
}
share|improve this answer
Thanks, I was kind of hoping for a solution that didn't involve coding a module... the project is now over, but I guess if it is something I need to ever deal with again, I will suggest a developer do that part of the work. – Jane Sep 20 '11 at 16:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.