• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
can't get DOMDocument from WebView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

can't get DOMDocument from WebView


  • Subject: can't get DOMDocument from WebView
  • From: Kenny Leung <email@hidden>
  • Date: Tue, 2 May 2006 14:09:31 -0700

Hi All.

I've been working all morning trying to get A DOM Document from a WebView. Actually, I don't want to use a WebView. I just want to gain access to the DOM parsing functionality. I would be happy if I could get it without instantiating a WebView. Here is the code I've been using, complete with temporary hacks:

self = [super init];
if ( self ) {
window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
webView = [[[WebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)] autorelease];
[window setContentView:webView];
[window makeKeyAndOrderFront:self];
frame = [webView mainFrame];
request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:path]];
data = [NSData dataWithContentsOfFile:path];
// [frame loadRequest:request];
string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
[frame loadHTMLString:string baseURL:[NSURL URLWithString:@"http://www.quickceph.com";]];
// while ( ![frame dataSource] ) {
sleep(1);
// }
domDoc = [frame DOMDocument];
}



Everything checks out (not nil) until it gets to the last line of asking for the DOMDocument. The DOMDocument is nil. Has anyone else been successful at this?


Thanks!

-Kenny



_______________________________________________
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


  • Follow-Ups:
    • Re: can't get DOMDocument from WebView
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: NSTokenField, how to query the selection?
  • Next by Date: Re: Font Size Problem in NSTableView
  • Previous by thread: Re: NSString intValue
  • Next by thread: Re: can't get DOMDocument from WebView
  • Index(es):
    • Date
    • Thread