Вопрос по ambiguity, xml, xsd – Неоднозначность модели содержимого в схеме

2

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Quick regexy respresentation:

foo+ ( bar baz* | bar? baz+ qux* )
foo is required (one-or-more) If bar exists, baz is optional (zero-or-more) If baz exists, bar is optional (zero-or-one) and qux is optional (zero-or-more) qux can not exist if baz does not exist

Error: User Rate Limit Exceededfoo bar baz.

Ambiguous XSD document:

<xs:element name="parent">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="foo" minOccurs="1" maxOccurs="unbounded" />
            <xs:choice>
                <xs:sequence>
                    <xs:element name="bar" minOccurs="1" maxOccurs="1" />
                    <xs:element name="baz" minOccurs="0" maxOccurs="unbounded" />
                </xs:sequence>
                <xs:sequence>
                    <xs:element name="bar" minOccurs="0" maxOccurs="1" />
                    <xs:element name="baz" minOccurs="1" maxOccurs="unbounded" />
                    <xs:element name="qux" minOccurs="0" maxOccurs="unbounded" />
                </xs:sequence>
            </xs:choice>
        </xs:sequence>
    </xs:complexType>
</xs:element>

Screen capture for good measure:

Ambiguous XSD tree

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededbarError: User Rate Limit ExceededbazError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Edit:Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Ваш Ответ

1   ответ
4

(bar, (baz+, qux*)?) | (baz+, qux*)

Похожие вопросы