OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: Namespace question

[ Lists Home | Date Index | Thread Index ]
  • From: Norman Gray <norman@astro.gla.ac.uk>
  • To: Eric Bohlman <ebohlman@netcom.com>
  • Date: Tue, 11 Apr 2000 11:48:45 +0100 (BST)


Greetings,

On Mon, 10 Apr 2000, Eric Bohlman wrote:

> On Mon, 10 Apr 2000, Dylan Walsh wrote:
> 
      A few days ago, I said:
> > 	>- You don't choose the namespace prefix -- that's up to the person
> >     >who's writing the document.
> > 
> > I am under the impression that if when an XML parsers and DTD do not
> > distinguish the namespace prefix from the name of an element, that is if the
> > namespace prefix is "a" in the DTD, I use the prefix "b" in my document (but
> > it points to the same namespace URL), my document won't validate. Is this
> > correct?
> 
> You're correct.  <!ELEMENT> and <!ATTLIST> declarations deal with element
> and attribute names at the purely lexical level and treat QNames as
> literal strings.

Well, right.  If you're using a DTD then the DTD author has had to pick
a namespace prefix and use that as the prefix for the element type
declarations in the new DTD which are drawn from the namespace DTD.
However in DTD-less XML, the prefix would be arbitrary.  For example,
I could write

    <?xml version="1.0"?>
    <ping:html xmlns:ping='http://www.w3.org/TR/REC-html40'>
      <ping:head><ping:title>Frobnostication</ping:title></ping:head>
      [...]
    </ping:html>

and that would be a valid use of the HTML DTD used as a namespace DTD,
except that I've chosen to use `ping' as the namespace prefix instead
of the more obvious `html'.

When I started to process either this document or a document using a
DTD which had made a similar choice of prefix, it would, of course,
be the element type `ping:html' I'd have to match, since I'm not aware
of any automatic namespace processing tools that are available to
extract just an instance of the namespace DTD.

The fact that you can choose the prefix to use (or, conversely, that
the author of the namespace DTD does not fix the prefix) is surely
part of the point of namespaces, since it means that a document can be
(effectively) an instance of two DTDs which have element type names
which would otherwise clash.

In other words, the namespace syntax is just a reimplementation of the
Architectural Forms idea, with less flexibility and without tools to
support it directly.

Can anyone correct me here (if I'm wrong) -- the seeds of doubt have
been sown, and I'm starting to worry if I'm seeing more in the
namespace idea than is actually there.

All the best,

Norman

-- 
---------------------------------------------------------------------------
Norman Gray                        http://www.astro.gla.ac.uk/users/norman/
Physics and Astronomy, University of Glasgow, UK     norman@astro.gla.ac.uk


***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS