A modest proposal for namespaces

I know there is a lot of history out there wrt namespaces, and a lot
of feeling that it's just too messy.  I have a very simple proposal,
less than what I know many people want, but I'd like to float it here,
to find out exactly where it falls down.

Background: I want to include material from a document whose DTD I
don't control into a document whose DTD I control, AND be able to
point to identifiers in the included material.  Here's a mechanism
that allows that, and an example.  Apologies if this is a version of
long-since discarded proposal.  Does it work for you?

ht
------------------
Proposed changes to the standard to support namespaces:

namespaceSection ::= '<!NS[' %Name '[' (%markupdecl*|%content*) ']]>'

Allow namespaceSection in expansions of markupdecl and content.
-------------------

The intent is that for something like

  <!NS[ some-identifier [

  . . . arbitrary XML . . .

  ]]>

the syntax is meant to be very similar to e.g. an INCLUDE marked
section, but has the additional impact that every Name which appears
inside it (i.e. element GIs, attribute names, identifiers, enumerated
types) is particular to the namespace identified by 'some-identifier'.
The consequence of this INSIDE the namespace marked section is zero.
The consequences of this OUTSIDE are 2:

1) apparently identical names are not actually identical, e.g. in

  <book id=b1>Troilus and Cressida</book>
  <!NS[ excelbooks [
  <book id=b1><sheet>....</book>
  ]]>

not only are the two IDs not in conflict, the two books are different
element types as well.

2) From outside a namespace marked section, you can (only) refer to Names
inside a namespace marked section via a fully qualified name, e.g.

    excelbooks!b1

Full example:

Target doc't:

  <!doctype target SYSTEM "[sysid1]" [
  <!entity body SYSTEM "[sysid2]">
  ]>
  &body;

Matrix doc't

  <!doctype matrix ... [
  <!NS[ target [
  <!entity % targdtd SYSTEM "[sysid1]">
  %targdtd;
  ]]>
  <!element embed - - (target!body)>
  ]>
  <matrix>
  . . .
  <embed>
  <!NS[ target [
  &body;
  ]]>
  </embed>
  . . .
  <xref refid=target!id7>
  . . .
  </matrix>

Discussion point:  Should you be able to refer to a Name inside a
namespace m.s. from outside with an UNqualified Name, if the Name is
not defined in the referring context?

ht

Received on Sunday, 4 May 1997 15:52:13 UTC