Re: [xml] More uri.c bugs

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Mon Sep 04 2000 - 06:17:50 EDT


On Mon, Sep 04, 2000 at 01:15:04AM -0700, Wayne Davison wrote:
> I'm trying to use xmlBuildURI() in a program that needs to combine
> base and relative URIs together, and I found a number of things wrong.
> To facilitate testing, I modified testURI.c to allow a base URI to be
> used with an input file. (See the attached testURI.patch.)

  Thanks ! that something I needed to ease regression test
for the URI module but never did :-\

> Using this version of the program and the attached uri.data file, run the
> following command:
>
> ./testURI -base 'http://foo.com/path/to/index.html#help' <uri.data
>
> I believe that the output should be (and is with my patch):
>
> http://foo.com/path/to/index.html#help
> http://foo.com/path/to/
> http://foo.com/path/to/bar
> http://foo.com/path/to/bar#baz
> http://foo.com/path/to/bar?baz
> http://foo.com/path/to/index.html#baz
> http://foo.com/path/to/index.html?baz
> http://foo.com/path/up.a.notch.html#wow
> http://foo.com/path/up.a.notch.html?wow
> http://foo.com/root.cgi#OK
> http://foo.com/root.cgi?OK
> https://elsewhere.com/#deep
> https://elsewhere.com/?deep
>
> but is instead:
>
> ::ERROR::
> http://foo.com/path/to/
> http://foo.com/path/to/bar
> http://foo.com/path/to/bar
> http://foo.com/path/to/bar
> ::ERROR::
> ::ERROR::
> http://foo.com/path/up.a.notch.html
> http://foo.com/path/up.a.notch.html
> http://foo.com/root.cgi#OK
> http://foo.com/root.cgi?OK
> https://elsewhere.com/#deep
> https://elsewhere.com/?deep
>
> In other words, there were quite a few cases where the fragment and the
> query were either dropped, or were not allowed to parse without more of
> the reference URI being present.

  The point is that you modified the semantic of step 2 (adequately
modifying the comment). But step 2 (and the associated comment) is actually
extracted from RFC 2396 which precisely describes how the operation of
combining a base with an URI reference should be done to get the final
URI of the resource refered to.
  I'm a bit puzzled because your examples and the test case seems sound and
what one would expect in practice, but doesn't match with what the wording
in 2) seems to indicate. Something similar appears in 5), I think it's
okay anyway ...

> I'm assuming from the previous URI-bug
> discussion that we want to be able to combine "" with a base URI and get
> the base URI (the previous discussion made it sound like this is what
> happened even though it didn't work).
>
> I've attached uri.patch, with my suggested changes.

  Well, I trust you on this issue, I think you know this part of the code
better than me now :-). I will keep part of the old comment inherited from
the RFC for reference.
  I will add a testURI in the regression tests, this is not yet commited.

    thanks a lot,

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Sep 04 2000 - 09:48:28 EDT