At 10:48 AM 5/18/01, John Hanratty wrote:
>I also think mixed content is unavoidable and even desirable. The XML Book
>I have (Mastering XML, from Sybex), says that any element containing
>#PCDATA is by definition mixed content, and cites as an example
><!ELEMENT my.element (#PCDATA)>
> as well as the more obvious
><!ELEMENT my.element (#PCDATA) | mysub.element)>
>Are they wrong in identifying that first one as mixed content?
No, this is true to the XML Rec (3.2.2: Mixed Content). As I understand it,
in SGML a #PCDATA-only element was distinguished as "data content", which
still makes sense conceptually; but (partly since its modeling options for
mixed content are simplified), XML finds it possible to roll them in
together, at least as far as formal definitions are concerned.
W3C XML Schema follows this too: one way of modeling data content is to
have an optional <choice> group, say it's mixed, but give it no children.
This doesn't change the fact that it's generally useful to distinguish
between mixed content and data content (data-only content) for modeling,
especially since they have such different implications for processing.
>Re. your element for filtering: we have a similar problem, but solve it
>using attribues rather than an element.
Heh, that was one of the options I proposed. :-)
>You also mention that the filtered element can be a word, a sentence, or
Oh, I missed the multiple paras possibility. But this is covered nicely by
the "make the <filter> an element-content wrapper element" solution.
It's nice to see ERH (elsewhere in this thread) being so forthright about
youthful misconceptions. I guess the bottom line is to know what kind of
data you're dealing with and what your requirements are: even once you're
familiar with the "patterns" of modeling, it's clear there's no
Wendell Piez mailto:[log in to unmask]
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
Mulberry Technologies: A Consultancy Specializing in SGML and XML