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.
_______________________________________________