[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: How to enable stylesheet loading in KHTMLPart?
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2001-09-29 6:41:23
[Download RAW message or body]

On Sat, Sep 29, 2001 at 12:28:59AM -0400, Ellis Whitehead wrote:
> I have an xml file which references a style sheet:
> 	<?xml-stylesheet href="dict_web.css" type="text/css"?>
> 
> This works correctly from konqueror, but in an embedded KHTMLPart I'm using, 
> it just displays the file as though there were no style sheet.
> 
> How do you get KHTMLPart to load and process a style sheet for an xml file?

You have to tell KHTML that you want it to render the given URL as xml
document, not as html document. This is done by making use of URLArgs
and the serviceType field of it. Before calling openURL call setURLArgs
on the browserextension object with an URLArgs object which has the
serviceType field set to 'text/xml' . It works in Konqueror because Konq
always tries to figure out the real mimetype of an URL to open, and it
doesn't keep that information private but propagates it to the part.

Simon

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic