Seeking Atom Debugging Help
I’m producing an Atom 1.0 feed in a servlet. To debug, I’m pointing Firefox at the feed URL. But Firefox shows a “friendly” page that formats the page as HTML and prompts me to subscribe.
When I view the page source in Firefox, I see HTML and RSS from the “user friendly” subscription page. I really want to see the raw Atom XML source.
I get similar results in IE and Safari. UPDATE: It seems that I can view source in IE, and I see the original Atom feed.
Is there a way to view the raw feed XML source in Firefox???
UPDATE 2: I am at home now, trying this in Firefox on my blog’s feed. I can view page source just fine and I see the Atom feed content. Now I’m completely confused by what I saw at work. When at work, hitting a servlet that generated Atom, the page source was always the “friendly” page. But at home, hitting a different Atom feed, I’m seeing the raw feed source. I don’t get it. Maybe I’m just nuts.
Did you try firebug?
in Firefox, you can also use “View Source”
Yes, Firebug could probably help you. Anything that goes on a webpage should be inspected through it.
You can also view your raw XML through Telnet if you are so inclined (or write a quick socket to fetch it from the source)
In Firefox just press Ctrl+u (Win&Linux) or Cmd+u (Mac) ;-).
check out the chrome file in C:\Program Files\Mozilla Firefox\chrome\
There are several jar’s in there. They’re just zip files, just with a .jar extension.
(you probably know all of this already, I’m just trying to be complete)
Check out:
browser.jar\content\browser\content\feeds
and
classic.jar\skin\classic\browser\feeds
especially:
browser.jar\content\browser\content\feeds\subscribe.{xhtml/js}
They seem to hold the magic that does all of this stuff.
It seems like there is a Javascript object (constructor-thing), BrowserFeedWriter, which handles the “take an XML file and convolute it to fit out format” thing.
I use Feed Proxy: http://persistent.info/feed-proxy/. Solves the very problem I think you’re running into and works a treat.
What’s the content type of the feed that’s being returned from your servlet? Is it text/html instead of one of:
1. application/atom+xml
2. application/xml
3. text/xml
Just wonderin’
-m
Personally I found this project: https://sourceforge.net/projects/feedvalidator/ that look good on paper and in code, but never managed to make it work!
With a Content-Type: text/plain you will see actual markup straight in your browser window. Afterwards, change it back to whatever you’re using in production.
Moreover, gedit (being pretty simple text editor) actually can open pages from the net… And it never messes with the actual content, be it application/xml or image/png or whatnot.
Use unittests to do “testing” and curl or wget to see the source when you need to (or cmd+u on firefox)… but test looking at the results seems a pretty slow method of testing something may I say.
I don’t know if you’re a huge IE7 fan or not, but you can turn the preview functionality off completely by going to Tools -> Internet Options -> Content, choose the Feeds Settings button and deselect feed reading view.
For FF, there’s no way directly I know of to turn it off, but you could hack FeedConverter.js if you wanted.
If your feed is publicly accessible, you can go to http://feedvalidator.org and they’ll validate it.
I’d just use curl. You could also write an automated test which parses the feed w/ Rome and validates the content.
+1 for curl.