Re: [code-review] WebService::Validator::HTML::W3C

[email protected] (Mark Dominus) Fri, 14 Nov 2003 14:20:26 -0500
Newsgroups gmane.comp.lang.perl.code-review-ladder
Message-ID <[email protected]>
"Hodges, Paul" <Paul.Hodges-ntWzkUHD06N8olp/[email protected]>:
> > From: Peter Scott [mailto:[email protected]]
> > 
> > I'd change it to "scheme".
> > 
> > http://www.w3.org/Addressing/URL/4.1_Schemes.html
> 
> Ok, I see that "scheme" is the word they use, but the above link also refers
> to them as protocols.
> Protocols I understand. "Scheme" seems like a needless complication,

Each URL 'scheme' implies several things.

It implies an access protocol that the client should use to get the
information. 

But more important, it also implies a set of rules for parsing and
interpreting the part of the URI that follows the ':'.  The rules for
interpreting the following part depend on the scheme.

Consider, for example, the three URIs:

        ftp://perl.plover.com/foo.html#carrot

        http://perl.plover.com/foo.html#carrot

        mailto://perl.plover.com/foo.html#carrot

All these require that the client use different protocols to access
the information, but the difference doesn't stop there.  In the first
URI, the '#carrot' part is part of the document name.  In the second,
it is not; it is an internal anchor identifier.  The '#' character is
special in the second URI but not in the first.

The '/' character was special in the first two URIs, but it isn't
special in the third one.

There is nothing to stop my from defining a URI scheme that looks like this:

        xhttpmjd://perl.plover.com/foo.html#carrot

where the protocol is still HTTP, but the interpretation of the 
"//perl.plover.com/foo.html#carrot" part is entirely different from
the usual interpretation.  

So 'protocol' is part of 'scheme', but the really important part is
the scheme for understanding and decoding the rest of the URI.

That is why they use the word 'scheme' and not 'protocol'.

> but I haven't read the RFC, so I'll assume it's there for a reason,
> and continue to use "protocol" until that fails to make sense. :)

The word 'scheme' is correct here.  'protocol' is something else.  
The only reason you though 'protocol' made sense here is because you
didn't understand the difference.