Why does the namespace in XML indicate http :?

Please clarify something for me. I study WCF and see the ServiceContractAttribute parameter with the Namespace = "http://www.mywebsite.com/andsoforth" parameter

I read in another question that Namespaces are unique opaque keys. Instead of using GUIDs, they are often URLs because legitimate ones are guaranteed to be unique.

Why is the "http:" schema specified with the namespace URL? Why not just a URL?

Thanks for clarifying this.

+5
source share
4 answers

, http://, URI , , -. ( 2009 XML-DEV, , XML , () URL- ( URN) URI. XML XML, , ? , .)

HTTP-URL- ? , , , ? .

? , DNS Java. , .

. , . URNs, DNS Java.

+3

, ( URI) . , http://www.w3.org/1999/xhtml XHTML, . - URI.

URI. , "directory.com", ://directory.com/file, . , , http://directory.com/file. , , .

, URI . URI .

, . , , , - , , .

+2

, , http:// , , , , - . , RDDL, . , URL- . , , http://www.w3.org/2001/XMLSchema .

, , URI , , URL ( URL), , .

+1

. . XML URI, URL-. URL- , , . , , , URL-, http://www.mycompany.com/.. URI .

In most cases, I prefer to make it clear that I am using a URN, which is a URI that is not a URL. I even add a prefix to the value so that it is clear that this is what I am doing. Something like this "urn: mycompany.com/schemas/services/foo/bar/20111119.

0
source

All Articles