From kde-core-devel Sun Sep 30 03:28:52 2001 From: Ellis Whitehead Date: Sun, 30 Sep 2001 03:28:52 +0000 To: kde-core-devel Subject: Re: How to enable stylesheet loading in KHTMLPart? X-MARC-Message: https://marc.info/?l=kde-core-devel&m=100182039120446 Correction to what I just wrote: The code below does try to load the css file, but its behavior is different depending upon the form of the URL: > { > KParts::URLArgs args; > args.serviceType = "text/xml"; > m_pPart->browserExtension()->setURLArgs( args ); > > m_pPart->begin(); > m_pPart->write( sXML ); > m_pPart->end(); > } 1) 2) 3) (1) crashes with the following kdDebug output: khtml (memory): KHTMLPart::clear() this = 0x80db760 kdecore (KURL): KURL couldn't parse URL "dict_web.css" kdecore (KURL): KURL couldn't parse URL "dict_web.css" kdecore (KURL): KURL couldn't parse URL "dict_web.css" khtml (cache): Cache: Malformed url: dict_web.css KCrash: crashing.... crashRecursionCounter = 2 KCrash: Application Name = lt-dict path = pid = 2276 trying to open styleStr..: HighColor got (nil) (2) displays the XML unformatted -- as does any invalid href. kdDebug output: kio (KIOJob): error 11 //dict_web.css (3) displays correctly, but I want to use relative paths instead of absolute... When using openURL, (1) works correctly. kdDebug output is as follows: KHTMLMainWindow::openURL( file:/home/ellis/xml2/dict4/test/phrase.xml ) KHTMLDataPart::openURL( file:/home/ellis/xml2/dict4/test/phrase.xml ) khtml (part): KHTMLPart::openURL file:/home/ellis/xml2/dict4/test/phrase.xml khtml (part): closing old URL khtml (part): KHTMLPart::openURL now (before started) m_url = file:/home/ellis/xml2/dict4/test/phrase.xml khtml (memory): KHTMLPart::clear() this = 0x80db728 khtml (part): SSL in use? khtml (part): setIcon unlock done. kdecore (KURL): KURL couldn't parse URL "dict_web.css" Do you know what does one need to do to get relative paths working for stylesheets when not using openURL()? Thanks again! Ellis