1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 06:20:23 +02:00

clarify uri fragment discussion

* doc/ref/web.texi (URIs): Clarify the discussion of URI fragments.
This commit is contained in:
Andy Wingo 2010-12-31 11:53:14 -05:00
parent d75a81b128
commit b3f9444892

View file

@ -175,23 +175,26 @@ URI := scheme ":" ["//" [userinfo "@@"] host [":" port]] path \
[ "?" query ] [ "#" fragment ] [ "?" query ] [ "#" fragment ]
@end example @end example
So, all URIs have a scheme and a path. Some URIs have a host, and some For example, in the URI, @indicateurl{http://www.gnu.org/help/}, the
of those have ports and userinfo. Any URI might have a query part or a scheme is @code{http}, the host is @code{www.gnu.org}, the path is
fragment. @code{/help/}, and there is no userinfo, port, query, or path. All URIs
have a scheme and a path (though the path might be empty). Some URIs
have a host, and some of those have ports and userinfo. Any URI might
have a query part or a fragment.
Userinfo is something of an abstraction, as some legacy URI schemes Userinfo is something of an abstraction, as some legacy URI schemes
allowed userinfo of the form @code{@var{username}:@var{passwd}}. allowed userinfo of the form @code{@var{username}:@var{passwd}}. But
Passwords don't belong in URIs, so the RFC does not want to condone since passwords do not belong in URIs, the RFC does not want to condone
this, but neither can it say that what is before the @code{@@} sign is this practice, so it calls anything before the @code{@@} sign
just a username, so the RFC punts on the issue and calls it
@dfn{userinfo}. @dfn{userinfo}.
Also, strictly speaking, a URI with a fragment is a @dfn{URI Properly speaking, a fragment is not part of a URI. For example, when a
reference}. A fragment is typically not serialized when sending a URI web browser follows a link to @indicateurl{http://example.com/#foo}, it
over the wire; that is, it is not part of the identifier of a resource. sends a request for @indicateurl{http://example.com/}, then looks in the
It only identifies a part of a given resource. But it's useful to have resulting page for the fragment identified @code{foo} reference. A
a field for it in the URI record itself, so we hope you will forgive the fragment identifies a part of a resource, not the resource itself. But
inconsistency. it is useful to have a fragment field in the URI record itself, so we
hope you will forgive the inconsistency.
@example @example
(use-modules (web uri)) (use-modules (web uri))