Re: Shorthand for default attributes (was: Re: Whitespace)

At 8:19 PM +0200 5/13/97, Bert Bos wrote:
>Alex Milowski writes:
> > Hmmm, looks similar to #CURRENT which is in SGML but not in XML.
> >
> > I have never found a *really good* reason for #CURRENT.  It would seem that
> > #CURRENT is also a "shorthand" for a container.
>
>There are at least two problems with #current: (1) it is not
>hierarchical, and (2) it is in the DTD and not in the document
>instance.

Both of these are critical.

> > We want parsing to be easy in XML--not harder because of special cases.  I
> > believe this is one of the reasons why #CURRENT was not included (among
>other
> > reasons that we don't need to go over again).
>
>I agree. It is easier to parse if there are no default attributes, and
>I like to keep the language as small as possible, but if there are
>many elements that need the same attribute value, then specifying that
>value in only one place is better in terms of document maintanance: it
>helps to avoid errors and is easier to change later.

That's why defaults are currently in. If you read the back-issues of the
list, you will see that we are waiting on ISO to allow separate ATTLIST
definitions, so that internal subsets can contain delcarations for default
Attribute values.

If not, a variety of other solutions have been floated. But it looks as
though ISO is oging to help us.

>
>The trade-off is whether such a mechanism will complicate the
>applications. I think declaring defaults for attributes locally, with
>scope until the end of the element in which they are declared, is not
>complicated to implement (it's a stack, and every parser needs a stack
>anyway), while providing a lot of benefit.

Yes, but it creates unbounded linear dependencies, forcing the parsing of
an entire document from the beginning, with all entitiy references
resolved. A State-independent solution allows "lazy" entity parsing, and
re-use of partial documents as well-formed XML fragments.

Alex's point (1) is so decisive that no other arguments are needed.


>I don't really mind the XML at the start, I was just trying to save a
>few bytes:-)
>
>And about your world: I haven't found any applications for PIs either,
>and I think that there aren't actually any worlds that need them.

PIs are allowed to users in XML (which I believe to be a mistake, but I'll
simply never use them, and progandize against their use, when I have a
chance). However, their use in XML itself has been very sensible: they
allow us to add the equivalent of new declarations and DTD features to XML
-- without having to use SGML-incompatible (or SGMl-invisible) syntax.

The use of namespaces for the PIs helps to control conflicts with the
"feature" of user-available PIs (which applications are _always_ entitled
to ignore, unlike the XML notations).

>PIs have been suggested for embedding stylistic information into
>documents in which people wanted to distinguish between stylistic and
>other information. But it turned out that style sheets are much
>better.
>
>They have been suggested for `meta-data', i.e., data *about* the
>document as opposed to the data contained in the document, but since
>PIs lack structure, that didn't work very well either. A link to
>external metadata, or even simply a <meta> element, is much better.

Since these straw men are not behind the syntax chosen, this is not an issues.

>
>As soon as you use PIs, you have to define a syntax for the string
>inside the PI. That's stupid, because XML already gives you a nice and
>flexible syntax, so why invent another?
We need a syntax distinct form tag syntax, because otherwise we are
imposing structure (and namespace pollution, and possibly unneeded
features) on user DTDs  -- whose applications are completely unpredictable
to us now.

   -- David

_________________________________________
David Durand              dgd@cs.bu.edu  \  david@dynamicDiagrams.com
Boston University Computer Science        \  Sr. Analyst
http://www.cs.bu.edu/students/grads/dgd/   \  Dynamic Diagrams
--------------------------------------------\  http://dynamicDiagrams.com/
MAPA: mapping for the WWW                    \__________________________

Received on Tuesday, 13 May 1997 15:25:09 UTC