[xml] More uri.c bugs

Date view Thread view Subject view Author view

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


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.)

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. 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.

..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 - 04:43:29 EDT