Re: A26: ANY keyword?

> >A.26 Like SGML, XML will allow elements to be declared ANY (11.2.4).
> 
> Upon further consideration, I think I'll vote NO on this one.  I can't
> think of a single time I've actually *used* ANY, and can't (in the abstract)
> think of situations where it is actually a worthwhile thing to do -
> particularly if we decide to lose exclusion exceptions.

There are some things that are hard to do without it...
(1) versioning.  SGML has no `transparent' element, that does not affect
    the content model in which it appears.  You can get a similar effect to
    a MODREQ element by using an EMPTY element with a marked section, where
    you put attributes on the element (e.g. ACTION=(delete|insert|revise),
    WHO=CDATA, and so on), but then you need to manage keeping the marked
    section (used to show the span of the change) with the empty element,
    and you really want an inclusion to allow it everywhere.

(2) When you can't work out the DTD; FRED helps a lot here, but I don't
    know if FRED could cope with the OED, for example.

(3) When you really don't care...

But ANY is always equivalent to
    (#PCDATA|every|element|in|the|DTD)*
so it can be dropped.

Actually I would favour dropping all connectors except |, so that
XML contents would always be (a|b|c|d)* and also dropping rcdata and cdata.
That way, you can get one of the two effects of an inclusion easily
(allow anywhere at this level, not in children) by adding to the or-group,
and the complexities of content models are considerably reduced from all
points of view.

Failing that, use normal regexp's and keep ANY...

Lee
 

Received on Sunday, 6 October 1996 19:34:10 UTC