Re: Using WebKit to display data that's not in HTML
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