Re: FW: Questions about RFC 2396

On Mon, 2003-02-24 at 08:54, Dan Connolly wrote:
> On Thu, 2003-02-20 at 11:16, Graham Klyne wrote:
> > Interesting case...
> > 
> > Dan, maybe add something based on this to your test cases [1]?
> > 
> >        ('http://ex/x/y', 'http://ex/x/q:r', 'q:r'),
> 
> No, that would violate the axiom
> 	x + (y-x) = y
> i.e.
> 	join(x, refTo(x, y)) == y
> 
> since join(x, z) = z when x and z are absolute
> and don't share a scheme, which is the case for
> 	join('http://ex/x/y', 'q:r')
> 
> It's quite necessary to escape the ':' for this reason.
> 
> I don't manage negative tests.

I take that back... the tests embedded in the docs
can accomodate this sort of thing; I added:

[[[
    Note the relationship between refTo and join:
    join(x, refTo(x, y)) == y
    which points out certain strings which cannot be URIs. e.g.
    >>> x='http://ex/x/y';y='http://ex/x/q:r';join(x, refTo(x, y)) == y
    0

    So 'http://ex/x/q:r' is not a URI. Use 'http://ex/x/q%3ar' instead:
    >>> x='http://ex/x/y';y='http://ex/x/q%3ar';join(x, refTo(x, y)) ==
y
    1
]]]

    

> > [1] http://www.w3.org/2000/10/swap/uripath.py
v 1.10 2003/02/24 15:06:38

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Monday, 24 February 2003 10:21:47 UTC