Re: [xml] More uri.c bugs

Date view Thread view Subject view Author view

From: Wayne Davison (wayned@blorf.net)
Date: Mon Sep 04 2000 - 16:57:05 EDT


On Mon, 4 Sep 2000, Daniel Veillard wrote:
> 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 was attempting to share some of the inheritance code, since steps 3 and
4 copy bits of the base URI into the result. However, since I managed to
get a couple details wrong, I think that going with the original idea of
more closely following the flow of the RFC is the better thing to do.

I saw two problems with my previous attempt -- it was inheriting the
fragment from the base when it shouldn't have, and was failing to inherit
the query from the base in one instance. In addition, I did some testing
with a few modern browsers (including NN 4.74, IE 5.5, Mozilla, and lynx)
and it revealed two areas of contention between the RFC and various
implementations:

  1) A completely empty URI is treated like "." rather than as a
      reference to the base URI (except in lynx). I just added a
      comment about this. Do we want to have xmlBuildURI() do this too?

  2) The step 2 processing specifies that the query string must be
      undefined, and this is how Netscape 4.x and lynx parses this.
      However, both IE 5.5 and Mozilla allow "?query" to refer to the
      current document. Since this makes more sense to me than what
      the RFC says, I added a comment about this and coded it that way.
      Any counter arguments to this?

Appended is a patch for uri.c. I slightly modified my test case to use
the following data (only slightly tweaked):

-----------------
 
.
bar
bar#baz
bar?baz
bar?baz#baz2
#baz
?baz
?baz#baz2
../up.a.notch.html#wow
../up.a.notch.html?wow
../up.a.notch.html?wow#wow2
/root.cgi#OK
/root.cgi?OK
/root.cgi?OK#OK2
http://elsewhere.com/#deep
http://elsewhere.com/?deep
http://elsewhere.com/?deep#deep2
-----------------

... the following command line (note the addition of "?orig"):

./testURI -base 'http://foo.com/path/to/index.html?orig#help' </tmp/uri.data

... and now get the following results:

http://foo.com/path/to/index.html?orig
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/bar?baz#baz2
http://foo.com/path/to/index.html?orig#baz
http://foo.com/path/to/index.html?baz
http://foo.com/path/to/index.html?baz#baz2
http://foo.com/path/up.a.notch.html#wow
http://foo.com/path/up.a.notch.html?wow
http://foo.com/path/up.a.notch.html?wow#wow2
http://foo.com/root.cgi#OK
http://foo.com/root.cgi?OK
http://foo.com/root.cgi?OK#OK2
http://elsewhere.com/#deep
http://elsewhere.com/?deep
http://elsewhere.com/?deep#deep2

..wayne..


----
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 - 18:43:35 EDT