-1

I am learning how to make Android applications from HEAD FIRST ANDROID. In one chapter we are making an application which will show the NASA DAILY IMAGE on an Android phone. We are using RSS feeds in it. The book says:

Go to "http://www.nasa.gov/rss/image_of_the_day.rss".  
Save the page locally as .XML file.  
Open it with Eclipse. Then this file will be opened by Eclipse's built-in XML file editor, which looks something like this: 

xml editor image

But when the page is saved as .XML and it is opened with Eclipse, it looks like this:

Screenshot
(Click image to enlarge)

How do I open an .XML file in the required format as shown in the first image?

1
  • Fascinating. It looks like it was detected as HTML because of its root element and you're in the HTML Editor.
    – nitind
    May 26, 2020 at 21:20

3 Answers 3

0

To open your XML file with Eclipse XML Editor :

  1. Start Eclipse
  2. Expand your project folder in Project Explorer window
  3. Copy/paste the XML file you have on your disk into your project folder within Eclipse.
  4. Then, in Eclipse, right-click the XML file
  5. Choose Open With --> XML Editor
0
0

Your Eclipse probably does not have the XML editing tools installed - there are several different Eclipse downloads and some of them don't include these tools.

You can install the XML tools by going to Help > Install New Software work with your Eclipse install site and find the Eclipse XML Editors and Tools in the Web, XML, Java EE and OSGi Enterprise Development section. You might want some of the other Web tools as well.

0

In Eclipse there is a built-in editor. You need to trick something to open it. I have gone through suggestions given by other people, but none of them works well. Instead of installing a new Eclipse XML editor, do this:

  1. Download NASA RSS file from http://www.nasa.gov/rss/dyn/image_of_the_day.rss .
  2. Convert extension to XML
  3. In Eclipse, File -> Open File... (See outline for hierarchical display)
  4. You can do editing on XML display by right-click -> Preferences.

Screenshot
(Click image to enlarge)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .