Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Multiple colons in namespace names?

Reply
Thread Tools

Multiple colons in namespace names?

 
 
Grant Robertson
Guest
Posts: n/a
 
      01-13-2007
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:

"urnasis:names:tc:entitymlnsml: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:

xmlnsasis="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.
 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      01-14-2007
In article <(E-Mail Removed)>,
Grant Robertson <(E-Mail Removed)> wrote:

>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:
>
>"urnasis:names:tc:entitymlnsml: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.
 
Reply With Quote
 
 
 
 
Grant Robertson
Guest
Posts: n/a
 
      01-14-2007
In article <eodn2p$2m46$(E-Mail Removed)>,
http://www.velocityreviews.com/forums/(E-Mail Removed) 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

"urnasis:names:tc:entitymlnsml: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="urnasis:names:tc:entitymlnsml :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.
 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      01-14-2007
In article <(E-Mail Removed)>,
Grant Robertson <(E-Mail Removed)> wrote:

>then what am I to make of all those colons? How would I specify that
>namespace in an XML document?
>
>xmlns:catalog="urnasis:names:tc:entitymlnsm 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.
 
Reply With Quote
 
Grant Robertson
Guest
Posts: n/a
 
      01-14-2007
In article <eodqq4$2nsg$(E-Mail Removed)>,
(E-Mail Removed) 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.
 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      01-14-2007
In article <(E-Mail Removed)>,
Grant Robertson <(E-Mail Removed)> wrote:

>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.
 
Reply With Quote
 
Joe Kesselman
Guest
Posts: n/a
 
      01-15-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
double colons in Javascript fpolowood@gmail.com Javascript 2 07-25-2007 08:44 PM
Colons, indentation and reformatting. (2) Paddy Python 9 01-10-2007 05:31 AM
Colons, indentation and reformatting. Paddy Python 2 01-09-2007 01:16 PM
About the use of double colons in javascript :: Québec Javascript 6 11-17-2003 10:10 PM
__doPostback method with colons problem Steven Livingstone ASP .Net 15 08-28-2003 12:57 AM



Advertisments