Re: [relax-ng] Making ambiguous schemas deterministic

From
James Clark <>
Date
2002-07-11T08:57:46+00:00
ID
002a01c228b8$b64b31f0$
Thread
Re: [relax-ng] Making ambiguous schemas deterministic
> I am wondering if another
> answer couldn't be to define an optional order which would be followed
> by a class of Relax NG implementations to produce a deterministic type
> assignments on ambiguous schemas.

Yes, I think this is an possibility. This is what regex implementations do:
they allow non-deterministic models, but they define an order so that \1,
\2,... have well-defined values.  Also I believe XSD does this for <union>:
the first choice wins (unless there's an xsi:type).

> I *think* (but may be wrong) that it shouldn't be much more complex than
> defining the order in which patterns should be checked and in the simple
> form of a Relax NG schema there are only 3 patterns with more than one
> non name class sub-pattern: group for which the order is obvious, choice
> and interleave.

I think this would be straightfoward for a naive backtracking implementation
to deal with, but I suspect it would be harder for a derivative-based
streaming implementation, but I haven't thouoght about it enough to be sure.

James