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

Re: Ambiguous Content Model

  • From: Rick Jelliffe <ricko@a...>
  • To: xml-dev@l...
  • Date: Fri, 05 Oct 2001 04:55:42 +1000

mark endicott
From: "Mark Endicott" <MEndicott@t...>
 
> It appears to me that (A,B)*, A? isn't impossible. Wouldn't this lead to the
> following list of possible child elements?
> 
> (no children)
> A
> A, B
> A, B, A
> A, B, A, B
> A, B, A, B, A
> ...
 
The ambiguity comes from a restriction which lets us use simple state machines
to implement parsing a content model: we read one element and decide which
state to go to next.  

If the grammar at the top is implemented as a state machine, the first
transition has two A choices: this is ambiguity.

There are various things we could do:  we could take the lexically first choice
in content model; we could rewrite the ambiguous content model into an
unambiguous one (often not difficult); we could allow a lookahead to the
possible states after the current As and then lookahead in the document
to the element after the current one; we could implement a weaker
validation which allows (a, b?)*. 

Or we could give up the ambiguity restruction and implement a different kind of 
validator: for example instead of a state machine, we could use a Petri net
and follow multiple paths.  

Cheers
Rick Jelliffe


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.