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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Ambiguous Content Models

[ Lists Home | Date Index | Thread Index ]

On Fri, 2003-10-03 at 12:42, Max Chappell wrote:

> Does anybody have any comments on the validity of the above? 

The IBM Schema Quality Checker is right...

If you have several "Person" elements in your instance document, a
schema processor can't immediately tell if they belongs to the first
sequence, to the xs:element that follows or to the second sequence and
that's violating the restrictions of W3C XML Schema.

Furthermore, your schema is not capturing "they want any element of the
three elements in any order, as many or as few times as they want" :-)
...

The usual way to translate "any element of the three elements in any
order, as many or as few times as they want" in WXS is through
xs:choice:

    <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="tns:GenericElements"/>
        <xs:element name="Person" type="tns:Person"/>
        <xs:element name="Location" type="tns:Loc"/>
    </xs:choice>

That doesn't capture the fact that "they also want at least one 
person element to be present every time" but I don't see how you can
capture this using WXS alone.

Hope this helps.

Eric
-- 
Lisez-moi sur XMLfr.
                       http://xmlfr.org/index/person/eric+van+der+vlist/
Upcoming schema tutorial:
 - Philadelphia (7/12/2003)       http://makeashorterlink.com/?V28612FC5
Tutoriel XSLT:
 - Paris (25/11/2003)             http://makeashorterlink.com/?L2C623FC5
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS