<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=XML_Tutorial%2FXML_Schema%2Fchoice</id>
		<title>XML Tutorial/XML Schema/choice - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=XML_Tutorial%2FXML_Schema%2Fchoice"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/choice&amp;action=history"/>
		<updated>2026-04-04T12:29:28Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/choice&amp;diff=10625&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/choice&amp;diff=10625&amp;oldid=prev"/>
				<updated>2010-05-26T08:26:46Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 08:26, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/choice&amp;diff=10624&amp;oldid=prev</id>
		<title> в 18:22, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/choice&amp;diff=10624&amp;oldid=prev"/>
				<updated>2010-05-25T18:22:32Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Allow the document instance author to use the initial element twice==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;xsd:element name=&amp;quot;middleName&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:choice&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;initial&amp;quot; type=&amp;quot;xsd:string&amp;quot; maxOccurs=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;name&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/xsd:choice&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
&amp;lt;/xsd:element&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== &amp;lt;choice&amp;gt; Declarations==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;choice minOccurs=&amp;quot;non negative number&amp;quot; &lt;br /&gt;
        maxOccurs=&amp;quot;non negative number or unbounded&amp;quot;&amp;gt; &lt;br /&gt;
You can specify multiple child declarations within a &amp;lt;choice&amp;gt; declaration. &lt;br /&gt;
In an instance document, only one of the declarations may be used. &lt;br /&gt;
&amp;lt;choice&amp;gt; &lt;br /&gt;
    &amp;lt;element name=&amp;quot;first&amp;quot; type=&amp;quot;string&amp;quot; minOccurs=&amp;quot;1&amp;quot; maxOccurs=&amp;quot;unbounded&amp;quot;/&amp;gt; &lt;br /&gt;
    &amp;lt;element name=&amp;quot;middle&amp;quot; type=&amp;quot;string&amp;quot; minOccurs=&amp;quot;0&amp;quot; maxOccurs=&amp;quot;1&amp;quot;/&amp;gt; &lt;br /&gt;
    &amp;lt;element name=&amp;quot;last&amp;quot; type=&amp;quot;string&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;lt;/choice&amp;gt; &lt;br /&gt;
&amp;lt;choice&amp;gt; declaration may contain &amp;lt;element&amp;gt; declarations, element wild-cards, and inner &amp;lt;sequence&amp;gt;, &amp;lt;choice&amp;gt;, or &amp;lt;group&amp;gt;references.&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Creating a Set of Choices==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
With the default minOccurs and maxOccurs attribute values (both equal to 1), only one of the elements in a set of choices can appear. &lt;br /&gt;
If the value of the maxOccurs attribute is greater than 1, that value determines how many of the choices may appear. &lt;br /&gt;
A set of choices can also contain nested sequences, additional choice sets, or references to named groups.&lt;br /&gt;
A set of choices may be contained in a complex type definition, in sequences, in other sets of choices, or in named group definitions.&lt;br /&gt;
 &lt;br /&gt;
File: Schema.xsd&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;xsd:schema xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot;&lt;br /&gt;
  targetNamespace=&amp;quot;http://www.wbex.ru&amp;quot; xmlns=&amp;quot;http://www.wbex.ru&amp;quot;&lt;br /&gt;
  elementFormDefault=&amp;quot;qualified&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;animal&amp;quot; type=&amp;quot;animalType&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:complexType name=&amp;quot;animalType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:choice&amp;gt;&lt;br /&gt;
      &amp;lt;xsd:element name=&amp;quot;subspecies&amp;quot; type=&amp;quot;xsd:string&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
        &amp;lt;xsd:element name=&amp;quot;region&amp;quot; type=&amp;quot;xsd:string&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;xsd:element name=&amp;quot;population&amp;quot; type=&amp;quot;xsd:integer&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/xsd:sequence&amp;gt;&lt;br /&gt;
    &amp;lt;/xsd:choice&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
&amp;lt;/xsd:schema&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
File: Data.xml&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;animal xmlns=&amp;quot;http://www.wbex.ru&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;subspecies&amp;gt;Russia&amp;lt;/subspecies&amp;gt;&lt;br /&gt;
&amp;lt;/animal&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== You can further express occurrence behavior by using the minOccurs and maxOccurs attributes with either the choice element or the element declarations themselves.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;xsd:element name=&amp;quot;middleName&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:choice maxOccurs=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;initial&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;name&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/xsd:choice&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
&amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
The middleName element to contain one of two child elements: initial or name&lt;br /&gt;
&amp;lt;middleName&amp;gt;&lt;br /&gt;
  &amp;lt;initial&amp;gt;S&amp;lt;/initial&amp;gt;&lt;br /&gt;
&amp;lt;/middleName&amp;gt;&lt;br /&gt;
&amp;lt;middleName&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;Stolte&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;/middleName&amp;gt;&lt;br /&gt;
To allow for this content model, we would have to use the choice element:&lt;br /&gt;
&amp;lt;xsd:element name=&amp;quot;middleName&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:choice&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;initial&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;name&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/xsd:choice&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
&amp;lt;/xsd:element&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>