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

Non-deterministic schema issue....

  • To: xml-dev@l...
  • Subject: Non-deterministic schema issue....
  • From: "Andrzej Jan Taramina" <andrzej@c...>
  • Date: Wed, 30 Jan 2002 12:41:38 -0500
  • Organization: Chaeron Consulting Corporation
  • Priority: normal
  • Reply-to: andrzej@c...

schema is non deterministic
This exchange came up on a different newsgroup.  Anyone 
know what the correct answer is?

Thanks...

....Andrzej

--------------------------------


> > > MSXML4 is complaining about the schema below, saying that it is
> > > non-deterministic - i cant work out precisely why.
> >
> > >       <xsd:sequence>
> > >        <xsd:element name="characteristic" type="chartype1"
> > > maxOccurs="unbounded"/>
> > >        <xsd:element name="characteristic" type="chartype2"
> > > maxOccurs="unbounded"/>
> > >        <xsd:element name="characteristic" type="chartype3" minOccurs="0"
> > > maxOccurs="unbounded"/>
> > >        <xsd:element name="characteristic" type="chartype4"
> > > maxOccurs="unbounded"/>
> > >       </xsd:sequence>
> >
> > The problem is probably because of the minOccurs=0 on the third
> > element.  There is no way to know if the third element in such a
> > sequence is of type 3 or 4 without doing a read-ahead of it's child
> > elements.  I don't think that Parsers read-ahead typically.
> 
> But the minOccurs shouldnt be causing a problem. For starters, if we get rid
> of the minOccurs, the parser still complains. Are you saying that a schema
> enforcing the instance below would be non-deterministic because all the
> elements in the sequence have the same name?
> 
> <library>
>     <publication type="journal">...</publication>
>     <publication type="journal">...</publication>
>     <publication type="journal">...</publication>
>     <publication type="hardback"/>...</publication>
>     <publication type="book"/>...</publication>
>     <publication type="book"/>...</publication>
>     <publication type="book"/>...</publication>
>     <publication type="book"/>...</publication>
>     <publication type="reference"/>...</publication>
>     <publication type="misc"/>...</publication>
>     <publication type="misc"/>...</publication>
> </library>
> 
> 
> How else do you get around this? Giving each element a unique name would be
> a little silly, especially when there could be hundreds of them. besides..
> if you then wanted to transform the XML into some HTML (as i do).. it would
> be much trickier.

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


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.