W3C home > Mailing lists > Public > uri@w3.org > February 2008

Re: Syntax-based normalization on relative URIs?

From: Mike Brown <mike@skew.org>
Date: Sun, 24 Feb 2008 00:16:53 -0700 (MST)
Message-Id: <200802240716.m1O7Gr1o051368@chilled.skew.org>
To: Sebastian Pipping <webmaster@hartwork.org>
CC: uri@w3.org

Sebastian Pipping wrote:
> Sebastian Pipping wrote:
> > Why are dot segments not removed when normalizing
> > relative URIs? For example this testcase from 4Suite:
> > 
> >   pathSegmentNormalizationTests = [
> >     ..
> >     ('a/b/../../c', 'a/b/../../c'),
> >     ..
> > 
> >   (and not "c" instead)
> > 
> > A short explanation or a link would be great.
> 
> Anybody? I had code normalizing relative
> URIs almost ready and then stumbled upon
> this testcase again. In case I asked this
> before I cannot find the related mail.
> Please help me!

That particular test is for a pair of functions that implement RFC 3986 sec. 
6.2.2.3 (Path Segment Normalization). One function takes a full URI or URI 
reference, and the other takes just the path component of a URI or URI 
reference. They each return a string with the path normalized. However, the 
API docs for those functions say "If the path is relative, it is returned with 
no changes." So the test case you're looking at is reflecting that 
expectation.

I'm having trouble remembering why I did this.

Mike
Received on Sunday, 24 February 2008 07:17:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:12 UTC