Subject: Re: Core ideas behind SGML and XML
From: Erik Naggum <erik@naggum.no>
Date: 01 Oct 2002 13:20:50 +0000
Newsgroups: comp.lang.lisp
Message-ID: <3242467250693615@naggum.no>

* Rob Warnock
| Thank you! That was exactly the sort of terse overview I was hoping for.

  Happy to oblige, but I think I should whip up a web page on this now that
  I think I got it reasonably right.  The standing-on-one-leg stunt is hard.

| Clearly, since a DTD can specify that some subset of sub-elements (in
| arbitrary order) *must* come before all the other permitted sub-elements,
| then "attributes" could just as easily be expressed as sub-elements with
| restrictions on order, much like declarations and documentation strings
| in CL, yes?

  There is a crucial difference between attributes and subelements today
  that needs to be taken care of in an attribute-free SGML.  Attributes are
  local to their element and therefore can be the same name as an element.
  They could also differ in type from element to element, which translates
  to a different content model or notation as an element.

| | Using ID and IDREF is exactly analogous to using #n= and #n#.
| 
| Aha! That's what I get for not having read the actual SGML specs, I guess.

  But you may need to know #n= and #n# and that they are analogous to see
  this because the application gets to maintain its own table of IDs and
  map the IDREFs back to them, which is kind of unfortunate.  Grasping that
  this can be used for circular structures is apparently hard for SGMLers
  when they have only learned to think of them in "See Figure 1" terms.

| I need to think about that one a bit more (and maybe go read some more).
| At the moment, it's certainly plausible to me that IDREF might need
| special syntax, but it seems like one might to be able to provide ID
| (albeit rather awkwardly!) with attribute-free elements [as above].

  One curious effect of moving from attributes to elements is that quite
  often, the best design is to let the attribute become a superelement
  instead of a subelement.

-- 
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.