DOMDocument Additions Reference

Inherits from
DOMNode : DOMObject : WebScriptObject : NSObject
Conforms to
DOMEventTarget (DOMNode)
NSCopying (DOMObject)
NSObject (NSObject)
Framework
/System/Library/Frameworks/WebKit.framework
Availability
Available in OS X v10.3.9 and later.
Declared in
WebDOMOperations.h
Companion guides

Overview

Additions to the DOMDocument class facilitate communication between the DOM API and WebKit and help convert DOM URL element attributes into web-friendly NSURL objects.

Tasks

Getting the Web Frame

Constructing URLs

Instance Methods

URLWithAttributeString:

Constructs a URL given an attribute string.

- (NSURL *)URLWithAttributeString:(NSString *)string
Parameters
string

The HTML attribute string to convert.

Return Value

An NSURL object containing an absolute URL derived from the specified attribute string.

Discussion

This method constructs a URL given the string value of an element attribute. Examples include the href attribute of a DOMHTMLAnchorElement object, or the src attribute of a DOMHTMLImageElement object. This method only applies to attributes that refer to URLs.

This method is similar to URLWithString: in the NSURL class, except that URLWithAttributeString: handles relative URLs automatically based on the current document’s location.

Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebDOMOperations.h

webFrame

Returns the web frame associated with the DOM document.

- (WebFrame *)webFrame
Return Value

The web frame object for the receiver.

Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebDOMOperations.h