0

I have made a 'RSS Feed' app through parsing XML. Now I want to load the content into a UIWebView within a detail view, but not as a generic browser. I know that HTML content can be loaded in a UIWebView, so I want to convert the XML feed's content to HTML content and load it in the web view.

How could this be done?

Shaggy Frog
  • 27,575
  • 16
  • 91
  • 128
Steve Gear
  • 757
  • 2
  • 16
  • 44

2 Answers2

1

Generally, you can convert XML to XHTML using XSLT.

Unfortunately, as the following SO questions show, using the existing libxslt (and having a solution fully on the client) is not allowed on iOS for some reason. Or at least, has not been allowed in the past -- no idea if this is still true for iOS 4.3+.

Version of XSLT in iPhone

Alternative to NSXMLDocument on the iPhone for XSLT purposes

How do I include libxslt in my iPhone app?

No XSLTProcessor() support in Safari?

You may need to implement a server-side solution. (Which might not necessarily be a bad thing, since doing the work server-side means faster clients)

Community
  • 1
  • 1
Shaggy Frog
  • 27,575
  • 16
  • 91
  • 128
  • Another possibility is the recently released Saxon-CE javascript implementation of the Saxon XSLT engine http://www.saxonica.com/ce/download.xml. I've used some of the sites that are implemented with it on iOS Safari and they seem to work acceptably. – nine9ths Nov 08 '12 at 05:04
1

The RSS should have a "link" tag for every feed, which (link) holds the URL of the specific news tag. You can just load the link on a uiWebView.

Tim
  • 11,710
  • 4
  • 42
  • 43
Shad
  • 1,587
  • 2
  • 20
  • 29