Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loadRequest vs loadData



This was fixed recently:

http://trac.webkit.org/projects/webkit/changeset/24392

On Aug 16, 2007, at 4:44 PM, James Rodden wrote:

I've solved the problem!

Essentially loadHTMLString and loadData are both picky about the baseURL they're given...it must be absolute, not relative.

For those interested, I've inlined the changes below.

Thanks for the pointers Geoffrey!

Jim

On Aug 15, 2007, at 2:12 PM, Geoffrey Garen wrote:


        I would recommend starting with a very simple HTML string, getting that working, and then building up to fancier features, like loading the string from disk, and then modifying it in memory. It's hard to debug this issue in the abstract.

        Geoff

        On Aug 15, 2007, at 2:02 PM, James Rodden wrote:


                I'm resubmitting this question because I really need help with this and haven't gotten any responses yet;
               
               
               
                I'm trying to better understand (and debug) the page load process. I
               
                have an xml file that loads an xsl stylesheet to convert it to html.
               
                When I use the following line, it works as expected:
               
               
               
               
                const NSURL* fileURL =
                [NSURL URLWithString:@"myxml.xml" relativeToURL:absoluteURL];
               
               
               

replace with:
const NSURL* fileURL =
[[NSURL URLWithString:@"myxml.xml" relativeToURL:absoluteURL] absoluteURL];

               
                const NSFileHandle* fileHandle =
                  [NSFileHandle fileHandleForReadingAtPath:[fileURL path]];
               
                NSMutableString* myXML = [[[NSString alloc]
                initWithData: [fileHandle readDataToEndOfFile]
                  encoding: NSUTF8StringEncoding] autorelease];
               
                myXML = [[myXML mutableCopy] autorelease];
               
                // make some changes to the xml via insertString:
               
                [mainFrame loadData:[skinXML dataUsingEncoding:NSUTF8StringEncoding]
                  MIMEType:@"text/xml" textEncodingName:@"utf-8" baseURL:absoluteURL];
               

replace absoluteURL with fileURL for the "baseURL" argument.




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden

References: 
 >loadRequest vs loadData (From: "James Rodden" <email@hidden>)
 >Re: loadRequest vs loadData (From: Geoffrey Garen <email@hidden>)
 >Re: loadRequest vs loadData (From: "James Rodden" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.