[relax-ng] Re: Making ambiguous schemas deterministic

From
Kohsuke Kawaguchi <>
Date
2002-07-11T13:07:14+00:00
ID
Thread
[relax-ng] Re: Making ambiguous schemas deterministic
> Or have I missed something and is it more complex than this?

Sometimes, even if the grammar is unambiguous, it is hard to assign
types in a streaming fashion. Consider this:

<start>
  <element name="root">
    <choice>
      <ref name="foo1"/>
      <ref name="foo2"/>
    </
  </
</

<define name="foo1">
  <zeroOrMore>
    <element name="foo"><empty/></element>
  </zeroOrMore>
  <element name="one"><empty/></element>
</define>

<define name="foo2">
  <zeroOrMore>
    <element name="foo"><empty/></element>
  </zeroOrMore>
  <element name="two"><empty/></element>
</define>


This grammar is unambiguous because a valid instance can only yield one
interpretation. However, it's very hard to keep track of type assignment
to each element.

I guess in the world out there, most of the people write unambiguous
schema. So my feeling is that it's OK if we can guarantee that

1. there is a well-defined subset of RELAX NG,
2. the type assignment of those schemas are guaranteed to be unique, and
2. it can do a type assignment by a streaming processor



regards,
--
Kohsuke KAWAGUCHI
Sun Microsystems