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

Re: Again wit da AND and Repetitions / Singletons in a DTD

  • From: Lars Marius Garshol <larsga@i...>
  • To: "XML Developers' List" <xml-dev@i...>
  • Date: 15 May 1999 23:33:30 +0200

Re: Again wit da AND and Repetitions / Singletons in a DTD

* Terje Norderhaug
| 
| For example, take the content model (A & B & C) expressing that we
| require the three elements in any order. Here is the XML equivalent
| content model:
| 
| (A,((B,C)|(C,B))) | (B,((A,C)|(C,A))) | (C,((A,B)|(B,A)))

The number of states here more or less follows n factorial, leaving
the solution useless after 10 elements in a list or so.
 
| [...] This proves that supporting the AND connector isn't much
| harder than implementing the current connectors.

Given infinitely long paper tapes, yes. :)
 
| Simply make the parser keep track of which elements in the AND list
| have not yet been parsed. For each element encountered, remove its
| item from the list. [...]

This is essentially the same solution that John Cowan mentioned
earlier, and that I mused might be extended to cover the {m,n}
modifier as well.

However, I now see a potential problem with this in the presence of
ambiguous content models. I've taken a different line with this
compared to many of the others here, since I see no reason not to
allow them (they cause no harm in XML). Furthermore, the recommendation
only has a non-binding requirement that they be rejected. (I will warn
about them, but that's another matter.)

The problem is that if you generate a non-deterministic automaton from
the weaker content model (A | B | ...)* and convert it to a
deterministic one your deterministic states will be combinations of
the non-d ones, which (I think) may mean that in some cases you won't
know whether to enable the special & actions or not, since you don't
know whether you're inside the & group or outside it.

Does anyone know whether this really is a problem or not?

--Lars M.


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.