[Prev][Next][Index][Thread]

PIs and RE handling




> From: Charles@SGMLsource.com (Charles F. Goldfarb)
> Cc: w3c-sgml-wg@w3.org
> Date: Thu, 12 Sep 1996 10:14:43 GMT
> 
> the discussion was whether comment
> declarations couldn't do what PIs do. My point is, that's no improvement.

I certainly wouldn't advocate using comments to do what PIs do.  But I
might advocate using elements to do what PIs do, and introducing some
DTD feature to allow convenient specification of elements that can
occur anywhere (without the special RE treatment that 8879 gives to
inclusions).

> If the
> objective is DTDless parsing, the real problem isn't PIs but included
> subelements. Without the DTD, there is no way to distinguish them from proper
> subelements.

I would hope XML wouldn't have inclusions (at least not as they are in
8879).

> The net is that this is really a problem with RE handling, not with PIs per se. 

I agree there is a problem is with RE handling.  But one indirect way
to solve it is to make illegal in XML situations for which SGML
requires complex/non-intuitive RE handling.  Given our goals for
compatability of XML instances with SGML as it is today, there aren't
a lot of possibities for dealing with the RE handling problem.

A related problem for DTDless parsing is distinguishing between
element content and mixed content.  If I have an element that contains
just elements and white space, I don't know without the DTD whether
the white space should be treated as separators or data.

So one might argue that the problem is really mixed content, and that
the solution is to restrict it, by, for example, saying that elements
either

- have element content, in which PI, comments and so on would also be
allowed or

- have PCDATA content in which elements, PIs, comments are not
allowed

but they can't mix PCDATA with elements, PIs or comments in a single
element.

James


References: