W3C home > Mailing lists > Public > public-vocabs@w3.org > October 2011

Re: Canonicalizing relative URLs seen in URL type properties?

From: Philip Jägenstedt <philipj@opera.com>
Date: Thu, 20 Oct 2011 10:26:36 +0200
To: public-vocabs@w3.org
Message-ID: <op.v3m5qmh6sr6mfa@kirk>
On Thu, 20 Oct 2011 02:10:12 +0200, John Panzer <jpanzer@google.com> wrote:

> What are the rules for canonicalizing URLs seen in URL valued  
> properties?  I
> would guess that whether or not a value appears in an HTML URL attribute  
> or
> is encoded some other way with microdata, the rules should be the same.
>  Which implies paying attention to <base> tags etc.  Is this correct?

This is defined in  
<http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#concept-property-value>:

"The value is the absolute URL that results from resolving the value of  
the element's src/href attribute relative to the element at the time the  
attribute is set, or the empty string if there is no such attribute or if  
resolving it results in an error."

Following the references, you'll find that you need to resolve the URL by  
(basically) parsing it and then putting it back together while taking  
<base> into account.

-- 
Philip Jägenstedt
Core Developer
Opera Software
Received on Thursday, 20 October 2011 08:27:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 06:48:56 GMT