• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using WebKit to display data that's not in HTML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using WebKit to display data that's not in HTML


  • Subject: Re: Using WebKit to display data that's not in HTML
  • From: Sherm Pendley <email@hidden>
  • Date: Wed, 20 Sep 2006 15:25:58 -0400

On Sep 20, 2006, at 8:11 AM, Joe Goh wrote:

On 9/19/06, Sherm Pendley <email@hidden> wrote:
On Sep 18, 2006, at 1:34 AM, Joe Goh wrote:

> I'm trying to use a WebView to display some data that I have stored in
> CoreData, as I would like to use CSS to style the output.


Have you tried adding a '<?xml-stylesheet href="style.css" type="text/
css"?>' processing instruction to your XML? That's the W3C-blessed
method of attaching a CSS style sheet. I don't know if WebKit
supports it, but it's worth trying. IE and Mozilla both support it,
so it's not exactly obscure...

I've actually not even arrived at the stage where I need to use CSS yet. :-) Still trying to get my strings and other data in my CoreData persistent store displayed in a WebView.

Have you tried loading the XML using WebFrame's - loadData:MIMEType:textEncodingName:baseURL: method? Make sure you specify the correct MIME type of text/xml. WebKit already knows how to parse and display XML, so you don't need to jump as many hoops as you would for a completely new content type. All you need to do is attach a style sheet to the XML so that WebKit knows how to format it.


I've verified this in Safari. I opened an .xml file with the above stylesheet PI in it, and Safari used the CSS to format the XML for display. I'm assuming that's WebKit functionality, not something that's specific to Safari.

sherm--


Web Hosting by West Virginians, for West Virginians: http://wv-www.net Cocoa programming in Perl: http://camelbones.sourceforge.net


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Using WebKit to display data that's not in HTML (From: "Joe Goh" <email@hidden>)
 >Re: Using WebKit to display data that's not in HTML (From: Sherm Pendley <email@hidden>)
 >Re: Using WebKit to display data that's not in HTML (From: "Joe Goh" <email@hidden>)

  • Prev by Date: Re: rows of pop up button cells with unique menus
  • Next by Date: Re: NSViewAnimation: sliding one view down over another in a tab view
  • Previous by thread: Re: Using WebKit to display data that's not in HTML
  • Next by thread: NSTableView with NSPopupButtonCell and long menu -- how to scroll to selected item
  • Index(es):
    • Date
    • Thread