[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

  • To: xml-dev@l...
  • Subject: Why this restriction? (was Constraining a "mixed" mixed content model (XHTML <div>))
  • From: "Mark O. Zorro" <markozorro@f...>
  • Date: Mon, 12 Sep 2005 07:56:30 -0700
  • In-reply-to: <20050912080759.8E2D2C239EE@m...>
  • References: <20050912080759.8E2D2C239EE@m...>

restriction mixed content
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@f...

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.