Antone Roundy wrote:
>[snip]
> 2) If you're consuming Atom and you encounter a relative URI, how should
> you choose the appropriate base URI with which to resolve it?
> 
> I think there are only three remotely possible answers to #2: xml:base
> (including the URI from which the feed was retrieved if xml:base isn't
> explicitly defined), the URI of the self link, and the URI of the
> alternate link.  Given that Atom explicitly supports xml:base, if it's
> explicitly defined, it's difficult to justify ignoring it in favor of
> anything else.
> 

There is no basis in any of the specs for using the URI of the self or
alternate link as a base uri for resolving relative references in the
content.  The process for resolving relative references is very clearly
defined.

> If xml:base isn't explicitly defined, there may be some justification
> for using the self link rather than the URI from which the feed was
> retrieved.  It's sloppy on the publisher's part, but might be more
> likely to succeed in practice.
> 

-1.

> The alternate link is only a possible choice if there is at least one
> alternate link, and if either there is only one, or there are more than
> one, and all of them point to documents in the same directory. I'd say
> it's a fairly weak choice.
> 
> Conclusion: you've got to resolve relative URIs with respect to
> SOMETHING, and clearly the best choice is xml:base if it's explicitly
> defined. If not, the self link and the URI from which the feed is
> retrieved each have some merit.
> 

Wrong. You've got to resolve relative URI's with respect to the proper
base URI.  Let's reserve the sloppy guessing hacks for specs that
actually need them.

- James

Reply via email to