Multiple colons in namespace names?

Discussion in 'XML' started by Grant Robertson, Jan 13, 2007.

  1. 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:eek:asis: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:eek:asis="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.
    Grant Robertson, Jan 13, 2007
    #1
    1. Advertising

  2. In article <>,
    Grant Robertson <> 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:
    >
    >"urn:eek:asis: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.
    Richard Tobin, Jan 14, 2007
    #2
    1. Advertising

  3. In article <eodn2p$2m46$>,
    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:eek:asis: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/entity/specs/cs-entity-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:eek:asis: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.
    Grant Robertson, Jan 14, 2007
    #3
  4. In article <>,
    Grant Robertson <> wrote:

    >then what am I to make of all those colons? How would I specify that
    >namespace in an XML document?
    >
    >xmlns:catalog="urn:eek:asis:names:tc:entity:xmlns:xml: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.
    Richard Tobin, Jan 14, 2007
    #4
  5. In article <eodqq4$2nsg$>,
    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.
    Grant Robertson, Jan 14, 2007
    #5
  6. In article <>,
    Grant Robertson <> 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.
    Richard Tobin, Jan 14, 2007
    #6
  7. 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
    Joe Kesselman, Jan 15, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Livingstone

    __doPostback method with colons problem

    Steven Livingstone, Aug 4, 2003, in forum: ASP .Net
    Replies:
    15
    Views:
    737
    John Saunders
    Aug 28, 2003
  2. Paddy
    Replies:
    2
    Views:
    255
    Neil Cerutti
    Jan 9, 2007
  3. Paddy
    Replies:
    9
    Views:
    295
    Hendrik van Rooyen
    Jan 10, 2007
  4. Québec
    Replies:
    6
    Views:
    139
    Thomas 'PointedEars' Lahn
    Nov 17, 2003
  5. double colons in Javascript

    , Jul 25, 2007, in forum: Javascript
    Replies:
    2
    Views:
    98
    Erik Langhout
    Jul 25, 2007
Loading...

Share This Page