OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: What's ambiguous for Relax NG?


W3C XML Schema has two different constraints to insure "determism".

The following example (or rather its translation to WXS) is one of the few
non deterministic content models which cannot be rewritten as a
deterministic and valid W3C XML Schema:
grammar{

start = element book{ (odd,even)*,odd? }

odd=element odd-page{empty}
even=element even-page{empty}

}

It's ambiguous because in the following document:

<book><odd-page/></book>

we cannot say if the "odd-page" element has matched the first or the
second "odd" pattern.
This schema can be rewritten as:

grammar{

start = element book{ empty|odd|((odd,even)+,odd?) }

odd=element odd-page{empty}
even=element even-page{empty}

}

Even if this second flavor cannot be written as WXS either, I don't think
we can consider it as ambiguous since for any valid document we can say
without ambiguity which branch of the alternative matches the instance
document.
The same applies to patterns such as:

element foo{attribute bar{empty}} | element foo{element bar{empty}}

which can be rewritten as:

element foo{attribute bar{empty} | element bar{empty}}

I am wondering if, given the flexibility of Relax NG, there are any cases
left of ambiguous schemas which cannot be rewritten in a non ambiguous
form with the exception of ambiguous data types such as:
element foo{xsd:boolean|xsd:integer}

Thus my question: what should we call an abiguous Relax NG schema?

Thanks,

Eric
-- 
Freelance consulting and training.
                                            http://dyomedea.com/english/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]