<?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%2Frestriction</id>
		<title>XML Tutorial/XML Schema/restriction - История изменений</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%2Frestriction"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/restriction&amp;action=history"/>
		<updated>2026-04-04T18:51:43Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/restriction&amp;diff=10599&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/restriction&amp;diff=10599&amp;oldid=prev"/>
				<updated>2010-05-26T08:26:45Z</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/restriction&amp;diff=10598&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/restriction&amp;diff=10598&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;== Deriving by Restriction==&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:complexType name=&amp;quot;nameType&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:element name=&amp;quot;firstName&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:element name=&amp;quot;middleName&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:element name=&amp;quot;lastName&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:complexType&amp;gt;&lt;br /&gt;
&amp;lt;xsd:complexType name=&amp;quot;nameTypeRestricted&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:complexContent&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:restriction base=&amp;quot;nameType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
     &amp;lt;xsd:element name=&amp;quot;firstName&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;xsd:element name=&amp;quot;lastName&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:restriction&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:complexContent&amp;gt;&lt;br /&gt;
&amp;lt;/xsd:complexType&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Deriving Custom Simple Types==&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;
File: Schema.xsd&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;xs:schema xmlns:xs=&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;xs:simpleType name=&amp;quot;zipcodeType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xs:restriction base=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xs:pattern value=&amp;quot;\d{5}(-\d{4})?&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/xs:restriction&amp;gt;&lt;br /&gt;
  &amp;lt;/xs:simpleType&amp;gt;&lt;br /&gt;
  &amp;lt;xs:element name=&amp;quot;zipcode&amp;quot; type=&amp;quot;zipcodeType&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/xs:schema&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File: Data.xml (Both of these zipcode elements are valid.)&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;zipcode&amp;gt;11111&amp;lt;/zipcode&amp;gt;&lt;br /&gt;
&amp;lt;zipcode&amp;gt;11111-0987&amp;lt;/zipcode&amp;gt;&lt;br /&gt;
File: Data.xml (Both of these zipcode elements are invalid.)&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;zipcode&amp;gt;1111-12349&amp;lt;/zipcode&amp;gt;&lt;br /&gt;
&amp;lt;zipcode&amp;gt;111001&amp;lt;/zipcode&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== restriction specifies values for zero or more constraining facets==&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;!-- schema --&amp;gt;&lt;br /&gt;
&amp;lt;xsd:element name=&amp;quot;grades&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:simpleType&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:restriction base=&amp;quot;xsd:string&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:enumeration value=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:enumeration value=&amp;quot;B&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:enumeration value=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:enumeration value=&amp;quot;D&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:enumeration value=&amp;quot;F&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/xsd:restriction&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:simpleType&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;
== Restriction types are declared using the &amp;lt;restriction&amp;gt; declaration.==&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;restriction base=&amp;quot;name of the simpleType you are deriving from&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A derived type declared using the &amp;lt;restriction&amp;gt; declaration is a subset of its base type. &lt;br /&gt;
Facets control all simple types within XML Schemas. &lt;br /&gt;
A facet is a single property or trait of a &amp;lt;simpleType&amp;gt;. &lt;br /&gt;
For example, the built-in numeric type nonNegativeIntegerwas created by deriving from the built-in Integer type and setting the facet minInclusiveto zero. &lt;br /&gt;
&lt;br /&gt;
There are 12 constraining facets, described in the following table: &lt;br /&gt;
Facet                 &lt;br /&gt;
minExclusive          &lt;br /&gt;
minInclusive          &lt;br /&gt;
maxExclusive          &lt;br /&gt;
maxInclusive          &lt;br /&gt;
totalDigits           &lt;br /&gt;
fractionDigits        &lt;br /&gt;
length                &lt;br /&gt;
minLength             &lt;br /&gt;
maxLength             &lt;br /&gt;
enumeration           &lt;br /&gt;
whiteSpace            &lt;br /&gt;
pattern               &lt;br /&gt;
&lt;br /&gt;
Within a &amp;lt;restriction&amp;gt; declaration, you must specify the type you are restricting using the base attribute. &lt;br /&gt;
The base attribute is a reference to a global &amp;lt;simpleType&amp;gt; definition or built-in XML Schema datatype. &lt;br /&gt;
&amp;lt;attribute name=&amp;quot;kind&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;simpleType&amp;gt;&lt;br /&gt;
    &amp;lt;restriction base=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;enumeration value=&amp;quot;Home&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;enumeration value=&amp;quot;Work&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;enumeration value=&amp;quot;Cell&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;enumeration value=&amp;quot;Fax&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/restriction&amp;gt;&lt;br /&gt;
  &amp;lt;/simpleType&amp;gt;&lt;br /&gt;
&amp;lt;/attribute&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>