unifying the notion of Namespace and Notation

James Tauber jtauber at jtauber.com
Mon Mar 22 01:02:36 GMT 1999


As many of you know, I am a big fan of the under-appreciated Notation in
XML. What some have thought of as unnecessary baggage for XML to carry
around, I've thought of as a useful device whose absence would have only led
to hacks to achieve the same thing.

Many of you also know that I have variously called Notations "Namespaces for
Content" and Namespaces "Notations for Names". The more I think about it,
the more I think there is incredible overlap between namespaces and
notations. Reading through the RDF stuff yesterday, I became even more
convinced that this is the case.

Notations and Namespaces are both identified by URI. Actually, notations can
be identified by public identifier but I suspect this was largely because
people didn't feel comfortable with the idea of a URI that didn't point to
something. In this age of Namespaces and URI as Universal Identifier, there
is, IMHO, no need for notations having public identifiers. System
identifiers (URIs) will do. They don't need to point to anything.

Notations and Namespaces both have a Name which acts as an arbitrary,
internal proxy for the URI because URIs can't occur where notations and
namespaces need to be referred to.

Notations, as described in the XML 1.0 REC, serve three purposes.

Firstly, for declaring PI targets. At least in spirit, I see no difference
between this mechanism and the namespace mechanism. In the presence of a
notation declaration, PI target names are just like Namespace prefixes. They
are proxies; it's the notation URI that really identifies the target. IMHO,
Notations are Namespaces for PIs. Wouldn't it be nice if they used the same
mechanism. (issues: scope, PIs in DTDs). On an RDF note, an RDF document
describing an application (not a web page about an application, but the
actual *application*) might use a URI to identify an application. Is there
any reason why this should not be the *exact* same URI used for a notation
for PIs targetted at that application?

Secondly, Notations are used for identifying unparsed entity formats. We
don't say "this is a GIF file" because "GIF" isn't guaranteed universally
unique. So we use a URI. Sounds familiar? Notations are Namespaces for
unparsed entity formats. If we were describing an image file using RDF and
we wanted to say what format it was in, we might use a URI to identify the
format. Is there any reason why this should not be the *exact* same URI used
for unparsed entity notations? The current XSL WD mentions a mechanism for
indicating that the result tree is to be serialised as non-XML (IOW, an
unparsed entity). The specification of the non-XML format to use is via a
namespace. Here namespaces are used to identify a non-XML format. Exactly
the job of notations.

Third and finally (and this is my favourite use), Notations are used for
identifying the format of content. The spirit of XML is that
<Date>1999-03-22</Date> says that 1999-03-22 is a Date. Notation attributes
provide the means to say what format the Date is in ("YYYY-MM-DD" but
expressed as a URI) This is very similar to saying what format an unparsed
entity is in. In fact this is also similar to the way RDF might say John
Smith has a weight of 200 where 200 is in pounds and give a URI identifying
what "pounds" means (say http://www.nist.gov/units/pounds). Now this could
be achieved with notations, declaring a notation "pounds" with the URI just
mentioned and then using a notation attribute "unit" on a weight element
<weight unit="pounds">200</weight>. We'd probably also want to associate a
URI with the element type "weight". For this, we use Namespaces.

Is it just me or does this cry out for unification?

I would imagine that a schema language that uses RDF could easily unify
notations (at least the second and third type) into namespaces. A quick look
(read "search for the word notation") in DCD didn't seem to indicate that
*it* does, though.

James





xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list