all groups > dotnet xml > july 2004 >
You're in the

dotnet xml

group:

Namespaces ?



Namespaces ? Mike Morse
7/29/2004 11:34:05 AM
dotnet xml: What see sample that show xs:element where the xs namespace =
http://www.w3.org/2001/XMLSchema

However, I see another example with xsi: where xsi =
http://www.w3.org/2001/XMLSchema-instance

What's the difference here? Are there right and wrong namespaces? Is there
a global list of the ones to use? Does the namespace even need to point at
http://www.w3.org.....? Or is this just the accepted way?

Very appreciative,

Mike Morse

Re: Namespaces ? Dino Chiesa [Microsoft]
7/29/2004 1:48:18 PM
They are different namespaces that refer to different things.

for more on XML Namespaces, See
http://www.w3.org/TR/REC-xml-names/
http://msdn.microsoft.com/library/en-us/xmlsdk/html/xmconUsingNamespacesinSchemas.asp
http://msdn.microsoft.com/library/en-us/dnxml/html/xml_namespaces.asp
http://www.jclark.com/xml/xmlns.htm

The examples you cited do not "point to" www.w3.org. In fact, XML
Namespaces in general are supposed to be URI's, and are not necessarily
URL's.
The page I referenced above points to RFC2396 which clarifies the
distinction between URI's and URL's.
http://www.faqs.org/rfcs/rfc2396.html

In a nutshell, a URI is an Identifier, whereas a URL is special case of URI
that is also a Locator. My name "Dino Chiesa" is an Identifier, but is
not a Locator. (but, my name is NOT a URI, because it does not conform to
RFC2396). http://www.w3.org is both an identifier and a Locator. (both
a URI and URL). The string "urn:ThisIsMyNamespace" is a URI but not a
URL, as it provides no location information.

It just so happens that the URI's used for XMLSchema and XMLSchema-instance
(and many other XML namespaces) also act as URLs. It need not be so.
Designers often use http:// prefixes in XML namespaces, for a couple
reasons.
1. it makes the doc easy to find. If I want to learn about XML Schema, I
can go to http://www.w3.org/2001/XMLSchema
2. HTTP URLs are universal and hierarchical. For example, a namespace
like http://www.w3.org/2001/XMLSchema indicates that W3C owns it (or
published it), that it was finalized in 2001, etc. A namespace like
http://www.mycompanyname.com/Blah/Foo would indicate that MyCompanyName
specified it. So it's easy to discriminate namespaces this way.

But, on the other hand, dual use URIs tend to confuse people as to the
purpose and nature of XML Namespaces.

Microsoft has tried, in the namespaces it publishes, to use URNs as opposed
to URLs. I think.
For example, the Office Search Pane can interpret documents that conform to
the namespace "urn:Microsoft.Search.Response" . The namespace used in
ADO.NET DataSets is urn:schemas-microsoft-com:xml-msdata .

These are URI's (and URN's) but not URLs.

-D


[quoted text, click to view]

Re: Namespaces ? Mike Morse
7/29/2004 2:07:31 PM
Thank you very much, I will look at the resources you gave me.

-mike

[quoted text, click to view]

AddThis Social Bookmark Button