XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Is it valid in XSD to have choice where all particles are optional

Hi,

I have came across interesting problem in XSD. Assume the following
snippet of XML schema:

<xs:complexType name="foo">
  <xs:sequence>
    ...
    <xs:choice>
      <xs:element name="a" minOccurs="0"/>
      <xs:element name="b" minOccurs="0"/>
    </xs:choice>
    ...
  </xs:sequence>
</xs:complexType>

I have tried several validator and none of them reports error witch such
schema. However in section "3.8.4 Model Group Validation Rules" in XML
Schema Part 1 there is written:

"Nothing in the above should be understood as ruling out groups whose
{particles} is empty: *although no sequence can be ·valid· with respect
to such a group whose {compositor} is choice*, the empty sequence is
·valid· with respect to empty groups whose {compositor} is sequence or all."

Should this be understood as that above fragment of XSD is incorrect?

(Of course, it is better to write this as
    <xs:choice minOccurs="0">
      <xs:element name="a"/>
      <xs:element name="b"/>
    </xs:choice>
but lets focus on the original version).

Opinions from XML Schema experts welcomed.

Thanks,

				Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------

OpenPGP digital signature



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


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS