title: Relative CSS URL values with WebKit (Objective-C API)
body: <p>I want to change the URL's of a background-image property in a HTML document. </p>
  
  <pre><code>DOMCSSStyleDeclaration *style = domELement.style;
  NSString *imageURL = [style backgroundImage];
  </code></pre>
  
  <p>Now the imageURL looks something like <code>url(&lt;base URL I've loaded the HTML with&gt;/image.jpg)</code>. But in the HTML source it's <code>url(image.jpg)</code>.
  Now I'd like to change the image.jpg to an other image and still keep the relative path. How do I do that? Because when i set something like <code>url(newImage.jpg)</code> the rendered output looks like <code>url(&lt;base URL I've loaded the HTML with&gt;/newImage.jpg)</code>.</p>
  
  <p>May I change something when getting the HTML?</p>
  
  <pre><code>DOMHTMLElement *htmlElement = (DOMHTMLElement*)[document documentElement];
  NSString *html = [htmlElement outerHTML];
  </code></pre>
  
  <p>Or is there an other way how I can set a relative URL in a css attribute?</p>
  
  <pre><code>[style setBackgroundImage:@"url(newImage.jpg)"];
  </code></pre>