[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Namespace question

  • From: Norman Gray <norman@a...>
  • To: Eric Bohlman <ebohlman@n...>
  • Date: Tue, 11 Apr 2000 11:48:45 +0100 (BST)

namespace dtd


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'>

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 Gray                        http://www.astro.gla.ac.uk/users/norman/
Physics and Astronomy, University of Glasgow, UK     norman@a...

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


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.