我试图以任何顺序拥有这些子元素中的任何一个。但我也想允许任何其他元素。当我添加一个未在选项列表中定义的新元素时,我收到一个验证错误“元素下不允许元素”。
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://www.w3.org/2005/Atom" elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation>
This version of the Atom schema is based on version 1.0 of the format specifications,
found here http://www.atomenabled.org/developers/syndication/atom-format-spec.php.
</xsd:documentation>
</xsd:annotation>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd" />
<xsd:annotation>
<xsd:documentation>
An Atom document may have two root elements, feed and entry, as defined in section 2.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="feed" type="atom:feedType"/>
<xsd:element name="entry" type="atom:entryType"/>
...
<xsd:complexType name="feedType">
<xsd:annotation>
<xsd:documentation>
The Atom feed construct is defined in section 4.1.1 of the format spec.
</xsd:documentation>
</xsd:annotation>
<xsd:choice minOccurs="3" maxOccurs="unbounded">
<xsd:element name="author" type="atom:personType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="category" type="atom:categoryType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="contributor" type="atom:personType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="generator" type="atom:generatorType" minOccurs="0" maxOccurs="1" />
<xsd:element name="icon" type="atom:iconType" minOccurs="0" maxOccurs="1" />
<xsd:element name="id" type="atom:idType" minOccurs="1" maxOccurs="1" />
<xsd:element name="link" type="atom:linkType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="logo" type="atom:logoType" minOccurs="0" maxOccurs="1" />
<xsd:element name="rights" type="atom:textType" minOccurs="0" maxOccurs="1" />
<xsd:element name="subtitle" type="atom:textType" minOccurs="0" maxOccurs="1" />
<xsd:element name="title" type="atom:textType" minOccurs="1" maxOccurs="1" />
<xsd:element name="updated" type="atom:dateTimeType" minOccurs="1" maxOccurs="1" />
<xsd:element name="entry" type="atom:entryType" minOccurs="0" maxOccurs="unbounded" />
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:attributeGroup ref="atom:commonAttributes"/>
</xsd:complexType>