Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9248105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:53:11+00:00 2026-06-18T09:53:11+00:00

I am trying to read and parse an RSS feed. The header of the

  • 0

I am trying to read and parse an RSS feed. The header of the RSS feed is the following:

<rss version="2.0" xmlns:content="http://www.mywebsite.com" xmlns:media="http://search.yahoo.com/mrss/" >

I successfully retrieved both <title> and <link> from items but I can’t seem to find a way to retrieve <content:encoded> childs. That’s what I tryed so far:

<?php

//error_reporting(E_ALL);
//ini_set("display_errors", 1);

....

$x=$xmlDoc->getElementsByTagName('item');

foreach($x as $item) {
    $link = $item->getElementsByTagName('link')->item(0)->nodeValue;
    $title = $item->getElementsByTagName('title')->item(0)->nodeValue;
    $content = $item->getElementsByTagNameNS('http://www.mywebsite.com', 'encoded')->item(0);
    echo ("<p><a href='" . $link. "'>" . $title . "</a></p><p>" . $content . "</p>");
}

?>

As you can imagine $content is empty even if I try to get the nodeValue attribute, what am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:53:12+00:00Added an answer on June 18, 2026 at 9:53 am

    I ended up using SimpleXmlElement:

    $x = new SimpleXmlElement($s);
    
    foreach($x->channel->item as $entry) {
    
        $content = $entry->children("content", true);
        echo "<p>".$content->encoded."</p>";
    }
    

    Works like a charm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to parse this xml (http://www.reddit.com/r/videos/top/.rss) and am having troubles doing so.
I'm trying to read this ATOM Feed ( http://ffffound.com/feed ), but I'm unable to
I'm trying to read and the XML response from the following url http://sagt.vizushop.com/DefaultSimple.aspx?command=default I
I'm new to JSON and trying this tutorial: http://p-xr.com/android-tutorial-how-to-parse-read-json-data-into-a-android-listview/#comments I'm new to JSON, C
i try to parse within my iPhone SDK 4 http://de.news.search.yahoo.com/news/rss?p=iphone&ei=UTF-8&fl=0&x=wrt there are some german
I'm trying to read the Flickr feed in order to parse the images. However,
I've been trying to grab the Digg rss feed and parse its contents into
I am trying to read two Rss feed urls at regular intervals and display
I am trying to build an iPhone App, where I read an RSS feed
I'm really new to this and I'm trying to read an RSS feed, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.