472,119 Members | 1,003 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

Multiple colons in namespace names?

I am relatively new to XML, though I have taught myself a lot in the past
month. I keep seeing namespace names with multiple colons in them such
as:

"urn:oasis:names:tc:entity:xmlns:xml:catalog"

but I can't find any information on exactly what that means. Is that a
namespace defined within a namespace defined within a namespace? Are they
all nested within the same XML file? Or if I know the URI for "urn"
(which I presume is the commonly known URI for the Universal Resource
Number schema) and look at that schema will I find a namespace
declaration for "oasis"? I presume it will be something like:

xmlns:oasis="wherever the heck some default schema for OASIS is located"

Then if I look there I'm guessing I will find yet another schema with the
"names" namespace specified. Etc, etc, till I get to the declaration for
the catalog schema? It sure seems like a lot of hopping around when they
could have just specified the URI for the catalog schema in the first
place.

Thanks.
P.S. I understand that, technically, URIs don't need to point to any
actual file or even an actual server. However, I have found that all of
the ones I have explored actually do. We can discuss URIs later.
Jan 13 '07 #1
6 2095
In article <MP************************@news.newsguy.com>,
Grant Robertson <bo***@bogus.invalidwrote:
>I am relatively new to XML, though I have taught myself a lot in the past
month. I keep seeing namespace names with multiple colons in them such
as:

"urn:oasis:names:tc:entity:xmlns:xml:catalog"

but I can't find any information on exactly what that means. Is that a
namespace defined within a namespace defined within a namespace?
Colons are used to separate the prefix from the local part in an XML
element name, but colons in the URI associated with the prefix have no
meaning as far as XML is concerned.

<foo:bar xmlns:foo="urn:b:c:d"/>

The colons in "foo:bar" and "xmlns:foo" mean something to the XML
processor, but the ones in "urn:b:c:d" don't.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Jan 14 '07 #2
In article <eo***********@pc-news.cogsci.ed.ac.uk>,
ri*****@cogsci.ed.ac.uk says...
>
<foo:bar xmlns:foo="urn:b:c:d"/>

The colons in "foo:bar" and "xmlns:foo" mean something to the XML
processor, but the ones in "urn:b:c:d" don't.

So when I see something like

"urn:oasis:names:tc:entity:xmlns:xml:catalog"

defined as the namespace name for an Entity Catalog in the OASIS spec for
catalogs found at

http://www.oasis-open.org/committees...-xml-catalogs-
1.0.html#s.entity.catalog

then what am I to make of all those colons? How would I specify that
namespace in an XML document?

xmlns:catalog="urn:oasis:names:tc:entity:xmlns:xml :catalog" ??

How the heck is my XML parser supposed to identify and find the DTD or
schema for that namespace and validate against it? Or is my software just
supposed to have the schema for that namespace hard-coded into it and
already know how to parse any elements or attributes scoped as belong to
that catalog namespace? This seems counter to the spirit of XML.
Jan 14 '07 #3
In article <MP************************@news.newsguy.com>,
Grant Robertson <bo***@bogus.invalidwrote:
>then what am I to make of all those colons? How would I specify that
namespace in an XML document?

xmlns:catalog="urn:oasis:names:tc:entity:xmlns:xm l:catalog" ??
Yes.
>How the heck is my XML parser supposed to identify and find the DTD or
schema for that namespace and validate against it?
Namespace URIs are not primarily to identify schemas and DTDs, though
they can be used for that.
>Or is my software just
supposed to have the schema for that namespace hard-coded into it and
already know how to parse any elements or attributes scoped as belong to
that catalog namespace?
You don't need a schema to parse it, only to validate it.

You can give a schema location with xsi:schemaLocation in your document.

Of course, one to to find DTDs and schemas is to use a catalogue.
Presumably you know about that, since the URI you are asking about is
the namespace URI for catalogues!

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Jan 14 '07 #4
In article <eo***********@pc-news.cogsci.ed.ac.uk>,
ri*****@cogsci.ed.ac.uk says...
Of course, one to to find DTDs and schemas is to use a catalogue.
Presumably you know about that, since the URI you are asking about is
the namespace URI for catalogues!
Actually, I don't. That's why I was reading the spec. But I get your
point. They have an "official" name they want you to use and it is
supposed to be globally unique but I have to just trust them on that.
Then I can use a catalog file to allow my software to find the actual URI
of the schema or even just a mirror of that schema somewhere else.

You are correct, I improperly used "parse" as a synonym for "validate."
To me, it doesn't make much sense to parse without validation. It is very
important to me to ensure that data is correct before attempting to load
it into a memory structure for use by a program.
Jan 14 '07 #5
In article <MP***********************@news.newsguy.com>,
Grant Robertson <bo***@bogus.invalidwrote:
>To me, it doesn't make much sense to parse without validation. It is very
important to me to ensure that data is correct before attempting to load
it into a memory structure for use by a program.
Obviously data from unreliable sources has to be validated somehow.
But it doesn't have to be done with a general-purpose validator. It
can be done by your application as you use it to build the
structures, and typically it *has* to be done at least partly that
way, since schema languages can't express all the constraints
required.

And in many cases the data comes from a reliable source, and
validation is only useful for debugging. We run pipelines with
of the order of 100 steps; performing schema validation at every
stage would be very expensive.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Jan 14 '07 #6
Since XML itself never actually interprets/dereferences the namespace
name, this isn't really an XML question. But:

Namespace names are URIs. After the scheme identifier (which is
delimited by the first colon), the permissibility and meaning of the
rest of the line is defined by that specific scheme.

XML doesn't care. As far as we're concerned, a namespace is just a
literal string that happens to be expressed in absolute-URI-reference
syntax because we know how to manage that set of values to avoid
unintended conflict/reuse.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Jan 15 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

88 posts views Thread by Tim Tyler | last post: by
4 posts views Thread by SilverShadow | last post: by
66 posts views Thread by Darren Dale | last post: by
5 posts views Thread by Manu | last post: by
11 posts views Thread by Georg Teichtmeister | last post: by
7 posts views Thread by Kevin Newman | last post: by
6 posts views Thread by techBoy | last post: by
30 posts views Thread by Pep | last post: by
9 posts views Thread by Jeremy | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.