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

Re: Non-deterministic content model

  • From: Arthur Rother <rother@j...>
  • To: xml-dev@l...
  • Date: Thu, 14 Jun 2001 02:22:56 +0200

content model non deterministic
Hi

 > ((a, b)*, a?)

You can start unrolling this one, but you will never end it. It would look 
something like

(a,(b,(a,(b,(a,(..)?)?)?)?)?)?

So

 > It is provable that _every_ non-deterministic content model can be
 > converted to a deterministic content model. The trick is basically to
 > manually 'unroll' the content model.

would take you for ever to do so.

I came across this one in my first lessons on learning DTD's, where I tried 
to write a DTD for a game of chess:

         ((whitemove, blackmove)*, whitemove?)

I quickly loosed confidence in the power of content models.
luckily in the real world, one need not to be as restrictive.

the automation for recognizing a pattern following above rule is a very 
small and easy one as in

>         A       B
>0       1       -
>1       -       0

So you create kind of a simple loop. The trick, if one would write a parser 
that can parse
  ((a, b)*, a?)
is to unroll while you are parsing. but this is hard to recognize when to 
do so.

(a,(b,( (a,b)* a?) ?)?)?

If the unroller (dtd parser) comes to this situation, it could recognize 
the loop.
If this is the only endless case, one could hardcode this in the parser.

but it is easier to disallow 1-unambiguous content models.

How do

 > It is a point of incompatibility: From experience,
 > XML Spy and XMetal (I work for Softquad) will accept
 > it, msxml will not.

these tools deal with it?

Arthur



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.