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

  • Home
  • SEARCH
  • 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 6184975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:37:57+00:00 2026-05-24T01:37:57+00:00

How do I get the contents as a String using ROME in Java for

  • 0

How do I get the contents as a String using ROME in Java for some feed.

At the moment this is what I got

String feedURL = “...”;
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(feedUrl));

System.out.println(feed);

for (final Iterator iter = feed.getModules().iterator(); iter.hasNext();){
    System.out.println("\t" + ((Module)iter.next()).getUri());
}

System.out.println("Titles of the " + feed.getEntries().size() + " entries:");
for (final Iterator iter = feed.getEntries().iterator(); iter.hasNext();){
     System.out.println("\t" + ((SyndEntry)iter.next()).getContents());
}

Then the output of this is:

SyndContentImpl.interface=interface com.sun.syndication.feed.synd.SyndContent
SyndContentImpl.type=html
SyndContentImpl.mode=null

    SyndContentImpl.value=          <p><a href="http://www.flickr.com/people/64539367@N07/">MiscDot</a> posted a photo:</p>

<p><a href="http://www.flickr.com/photos/64539367@N07/5954881384/" title="03a"><img src="http://farm7.static.flickr.com/6024/5954881384_5390838321_m.jpg" width="240" height="240" alt="03a" /></a></p>

But what I want is to just get the string of the contents:
SyndContentsImpl.value

  • 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-05-24T01:37:57+00:00Added an answer on May 24, 2026 at 1:37 am

    Something like…

    for (Iterator<?> entryIter = syndFeed.getEntries().iterator(); entryIter.hasNext();) {
        SyndEntry syndEntry = (SyndEntry) entryIter.next();
    
        if (syndEntry.getContents() != null) {
            for (Iterator<?> it = syndEntry.getContents().iterator(); it.hasNext();) {
                SyndContent syndContent = it.next();
    
                if (syndContent != null) {
                    String value = syndContent.getValue();
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can I get the link of this string using preg match all ?
I am using the file_get_contents function to get the URL into a string: $contents
this is what i get as a string from a feed finder url (JSON
I would like to get contents of some stream or project I can find
I've got a simple php script to ping some of my domains using file_get_contents(),
I'm using this code to get an int value from 3 different servers: $js
I'm trying to read and store an RSS feed in my database using this
I'm wanted to read a rss feed and store it.for this I m using:-
I'm using file_get_contents('mysourcefile.html') to load the contents of mysourcefile.html into mysql db. I have
I get a page using file_get_contents from a remote server, but I want to

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.