Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 509323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:59:56+00:00 2026-05-13T06:59:56+00:00

Why this is non-deterministic and how to fix it? <xs:element name=activeyears> <xs:complexType> <xs:sequence minOccurs=0

  • 0

Why this is non-deterministic and how to fix it?

 <xs:element name="activeyears">
        <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="1">
                <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element ref="from" minOccurs="1" maxOccurs="1"/>
                    <xs:element ref="till" minOccurs="1" maxOccurs="1"/>
                </xs:sequence>
                <xs:element ref="from" minOccurs="0" maxOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

It is supposed to mean that <activeyears> is either empty or contains sequence of <from><till> which starts with <from> but can end with either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:59:57+00:00Added an answer on May 13, 2026 at 6:59 am

    A schema is non-deterministic when there are two branches that begin with the same element – so that you cannot tell which branch to take without looking ahead after that element. A simple example is ab|ac – when you see an a, you don’t know which branch to take. For loops, the “branch” is whether to repeat the loop, or continue after it. An example of this is a*a – once you are in the loop, and you read an a, you don’t know whether to repeat the loop, or continue.

    Looking at your example schema, imagine that it has just parsed a <till>, and now it needs to parse a <from>. You could parse it with the <from><till> loop or with the final <from>. You can’t tell which branch to use, just by looking at that <from>. You can only tell with further looking-ahead.


    Bad news: I think your example schema is a very rare one, that it is impossible to express deterministically!

    Here are the XML documents you want to accept (I’m using a single letter for each element, where a = <from>...</from> and b = <to>...</to>:

    *empty*
    a
    ab
    aba
    abab
    ababa
    ababab
    ...
    

    … you get the idea. The problem is that any letter can be the final letter in the sequence or it can be part of the loop. There is no way to tell which it will be, except by looking-ahead at the following letter. Since “deterministic” means that you don’t do this lookahead (by definition), the language that you want cannot be expressed deterministically.

    Simplifying your schema, it tries an approach similar to (ab)*a? – but both branches start with a. Another approach is a(ba)*b? – now both branches start with b. We can’t win!

    Technically, the set of all documents that a schema will accept is called that schema’s language. If no deterministic schema exists that can express a language, the language is called “one-ambiguous”.

    For a theoretic discussion, see the series of papers by Bruggemann-Klein (e.g. Deterministic Regular Languages and One-Unambiguous Regular Languages).
    She includes a formal test for one-unambiguous languages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
I have a window with 3 radiobuttons like this(removed all non interesting props): <Control
This is actually a non-critical question, but I get this warning most of the
This likely applies to non MVC too. But, Is it possible to use the
This is probably a stupid question, but what exactly is a non-blocking web server?
I have this href link with text either attivo or non attivo User can
I have added this rule in my web.config to redirect non www URLs to
I'm not sure if this is possible (complete non-flash developer speaking), but we have
I want to build a 2 dimensional (non ragged at this point) object array.
I was looking for a deterministic truncate function for datetime and this one did

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.