OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Why this restriction? (was Constraining a "mixed" mixed content model (

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: Why this restriction? (was Constraining a "mixed" mixed content model (XHTML <div>))
  • From: "Mark O. Zorro" <markozorro@fastmail.fm>
  • Date: Mon, 12 Sep 2005 07:56:30 -0700
  • In-reply-to: <20050912080759.8E2D2C239EE@mx3.messagingengine.com>
  • References: <20050912080759.8E2D2C239EE@mx3.messagingengine.com>

Michael Kay wrote:

> DTDs have the limitation that if an element allows PCDATA content
> (that is, text nodes as immediate children) then you can say which
> elements may appear as children, but you can't place any constraints
> on their order, cardinality, or coexistence.
> 
> You can do a bit better than this in XML Schema, but not as much
> better as one would like. If an element allows PCDATA content then
> you can't constrain where it appears relative to the child elements,
> or what the PCDATA actually contains.
> 
> Why not use two different elements, <block> which only allow
> block-level elements, and <text> which only allows inline-level
> elements?

To answer your last question first, I do not wish to add any new
elements to the XHTML vocabulary I'm now using. So I'm stuck with
having to use XHTML <div>.


Now, to comment on your reply, which does seem to be right (where in
the XML 1.0 spec does it specifically say DTDs are not allowed to
constrain as I'd like it to?)

From a philosophical perspective, I find it sort of perplexing why
there is this seeming limitation imposed upon DTDs. To me, a DTD's
purpose (or one purpose) is to define the grammar and vocabulary, and
to impose constraints on the use of this vocabulary in valid XML
instances.

It would seem, in the case I ask about, that a future version of XML
could easily, and without breaking current XML documents and DTDs,
give DTDs greater power at specifying constraints. It could augment
the Boolean-like logic system DTDs use to define the grammar so it
will make it more powerful and lead to simpler constraints.

Am I missing something here?

Thanks for your reply.

Mark
-- 
  Mark O. Zorro
  markozorro@fastmail.fm

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS