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

	<entry>
		<id>http://wbex.ru/index.php?title=XML_Tutorial/XML_Schema/simpleContent&amp;diff=10565&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/simpleContent&amp;diff=10565&amp;oldid=prev"/>
				<updated>2010-05-26T08:26:43Z</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/simpleContent&amp;diff=10564&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/simpleContent&amp;diff=10564&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;== As simple content models==&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;?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;empty&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:enumeration value=&amp;quot;&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;br&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xs:complexType&amp;gt;&lt;br /&gt;
      &amp;lt;xs:simpleContent&amp;gt;&lt;br /&gt;
        &amp;lt;xs:extension base=&amp;quot;empty&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;xs:attribute name=&amp;quot;id&amp;quot; type=&amp;quot;xs:ID&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;xs:attribute name=&amp;quot;class&amp;quot; type=&amp;quot;xs:NMTOKEN&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/xs:extension&amp;gt;&lt;br /&gt;
      &amp;lt;/xs:simpleContent&amp;gt;&lt;br /&gt;
    &amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;
  &amp;lt;/xs:element&amp;gt;&lt;br /&gt;
&amp;lt;/xs:schema&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Creating Elements with Simple Content and Attributes==&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;
When declaring an element that has simple content, you start with a basic element declaration: &lt;br /&gt;
&amp;lt;element name=&amp;quot;phone&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;!-- Specify type here --&amp;gt; &lt;br /&gt;
&amp;lt;/element&amp;gt; &lt;br /&gt;
Within the element declaration, you include a &amp;lt;complexType&amp;gt; declaration in which you specify that you want your element to have simple content. &lt;br /&gt;
You do this by creating a &amp;lt;complexType&amp;gt; declaration that contains a &amp;lt;simpleContent&amp;gt; element. &lt;br /&gt;
The &amp;lt;simpleContent&amp;gt; element indicates that the &amp;lt;complexType&amp;gt; cannot contain child elements. &lt;br /&gt;
It may contain attributes, but otherwise the content will be defined by a simple type.&lt;br /&gt;
&amp;lt;element name=&amp;quot;phone&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;complexType&amp;gt; &lt;br /&gt;
        &amp;lt;simpleContent&amp;gt; &lt;br /&gt;
            &amp;lt;!-- Specify type here --&amp;gt; &lt;br /&gt;
        &amp;lt;/simpleContent&amp;gt; &lt;br /&gt;
    &amp;lt;/complexType&amp;gt; &lt;br /&gt;
&amp;lt;/element&amp;gt; &lt;br /&gt;
Within the &amp;lt;simpleContent&amp;gt; element, you can create an &amp;lt;extension&amp;gt; declaration. &lt;br /&gt;
You must use an &amp;lt;extension&amp;gt; declaration because you will be extending an existing data type by adding attribute declarations. &lt;br /&gt;
&amp;lt;element name=&amp;quot;phone&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;complexType&amp;gt;&lt;br /&gt;
    &amp;lt;simpleContent&amp;gt;&lt;br /&gt;
      &amp;lt;extension base=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;attribute name=&amp;quot;kind&amp;quot; type=&amp;quot;string&amp;quot; default=&amp;quot;Home&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/extension&amp;gt;&lt;br /&gt;
    &amp;lt;/simpleContent&amp;gt;&lt;br /&gt;
  &amp;lt;/complexType&amp;gt;&lt;br /&gt;
&amp;lt;/element&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any of the following examples are allowable &amp;lt;phone&amp;gt;elements based on the previous declaration: &lt;br /&gt;
&amp;lt;phone kind=&amp;quot;Home&amp;quot;&amp;gt;001-909-555-1212&amp;lt;/phone&amp;gt; &lt;br /&gt;
&amp;lt;phone&amp;gt;001-909-555-1212&amp;lt;/phone&amp;gt; &lt;br /&gt;
&amp;lt;phone /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Defining Elements to Contain Only Text==&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;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;
&lt;br /&gt;
  &amp;lt;xsd:complexType name=&amp;quot;popType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:simpleContent&amp;gt;&lt;br /&gt;
      &amp;lt;xsd:extension base=&amp;quot;xsd:integer&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;xsd:attribute name=&amp;quot;year&amp;quot; type=&amp;quot;xsd:integer&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/xsd:extension&amp;gt;&lt;br /&gt;
    &amp;lt;/xsd:simpleContent&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:element name=&amp;quot;population&amp;quot; type=&amp;quot;popType&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/xsd:schema&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
File: Data.xml&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;population xmlns=&amp;quot;http://www.wbex.ru&amp;quot; year=&amp;quot;1999&amp;quot;&amp;gt;445&amp;lt;/population&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== element based on simple type==&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: Data.xml&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;INVENTORY&amp;gt;&lt;br /&gt;
   &amp;lt;BOOK InStock=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;TITLE&amp;gt;title 1&amp;lt;/TITLE&amp;gt;&lt;br /&gt;
      &amp;lt;AUTHOR Born=&amp;quot;1835&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;FIRSTNAME&amp;gt;Mark&amp;lt;/FIRSTNAME&amp;gt;&lt;br /&gt;
         &amp;lt;LASTNAME&amp;gt;Twain&amp;lt;/LASTNAME&amp;gt;&lt;br /&gt;
      &amp;lt;/AUTHOR&amp;gt;&lt;br /&gt;
      &amp;lt;BINDING&amp;gt;hardcover&amp;lt;/BINDING&amp;gt;&lt;br /&gt;
      &amp;lt;PAGES FrontMatter=&amp;quot;8&amp;quot;&amp;gt;298&amp;lt;/PAGES&amp;gt;&lt;br /&gt;
      &amp;lt;PRICE&amp;gt;5.49&amp;lt;/PRICE&amp;gt;&lt;br /&gt;
      &amp;lt;DATE&amp;gt;2000-03&amp;lt;/DATE&amp;gt;&lt;br /&gt;
      &amp;lt;ISBN&amp;gt;9-9999-9999-9&amp;lt;/ISBN&amp;gt;&lt;br /&gt;
   &amp;lt;/BOOK&amp;gt;&lt;br /&gt;
&amp;lt;/INVENTORY&amp;gt;&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;&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:element name=&amp;quot;INVENTORY&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
         &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:element name=&amp;quot;BOOK&amp;quot; type=&amp;quot;BookType&amp;quot; &lt;br /&gt;
               minOccurs=&amp;quot;0&amp;quot; maxOccurs=&amp;quot;unbounded&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:element&amp;gt;&lt;br /&gt;
   &amp;lt;xsd:complexType name=&amp;quot;BookType&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
         &amp;lt;xsd:element name=&amp;quot;TITLE&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:complexType mixed=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
               &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
                  &amp;lt;xsd:element name=&amp;quot;SUBTITLE&amp;quot; type=&amp;quot;xsd:string&amp;quot;&lt;br /&gt;
                     minOccurs=&amp;quot;0&amp;quot; maxOccurs=&amp;quot;1&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:element&amp;gt;&lt;br /&gt;
         &amp;lt;xsd:element name=&amp;quot;AUTHOR&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:complexType&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:attribute name=&amp;quot;Born&amp;quot; type=&amp;quot;xsd:gYear&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
         &amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
         &amp;lt;xsd:element name=&amp;quot;BINDING&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;hardcover&amp;quot;/&amp;gt;&lt;br /&gt;
                  &amp;lt;xsd:enumeration value=&amp;quot;mass market paperback&amp;quot;/&amp;gt;&lt;br /&gt;
                  &amp;lt;xsd:enumeration value=&amp;quot;trade paperback&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;&lt;br /&gt;
         &amp;lt;xsd:element name=&amp;quot;PAGES&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
               &amp;lt;xsd:simpleContent&amp;gt;&lt;br /&gt;
                  &amp;lt;xsd:extension base=&amp;quot;xsd:positiveInteger&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;xsd:attribute name=&amp;quot;FrontMatter&amp;quot; &lt;br /&gt;
                        type=&amp;quot;xsd:positiveInteger&amp;quot;/&amp;gt;&lt;br /&gt;
                  &amp;lt;/xsd:extension&amp;gt;&lt;br /&gt;
               &amp;lt;/xsd:simpleContent&amp;gt;&lt;br /&gt;
            &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
         &amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
         &amp;lt;xsd:element name=&amp;quot;PRICE&amp;quot;&amp;gt;  &lt;br /&gt;
            &amp;lt;xsd:simpleType&amp;gt;&lt;br /&gt;
               &amp;lt;xsd:restriction base=&amp;quot;xsd:decimal&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;xsd:minExclusive value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
                  &amp;lt;xsd:maxExclusive value=&amp;quot;100&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;&lt;br /&gt;
         &amp;lt;xsd:element name=&amp;quot;DATE&amp;quot; type=&amp;quot;xsd:gYearMonth&amp;quot; minOccurs=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;xsd:element name=&amp;quot;ISBN&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:pattern value=&amp;quot;\d{1}-\d{4}-\d{4}-\d{1}&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;&lt;br /&gt;
      &amp;lt;/xsd:sequence&amp;gt;&lt;br /&gt;
      &amp;lt;xsd:attribute name=&amp;quot;InStock&amp;quot; type=&amp;quot;xsd:boolean&amp;quot; use=&amp;quot;required&amp;quot; /&amp;gt;   &lt;br /&gt;
   &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
&amp;lt;/xsd:schema&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== The simpleContent element is used if the complex type may only have text content==&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;
The difference between this and a simple type is that it may carry one or more attributes. &lt;br /&gt;
The only children that are permitted for this element are the restriction and extension elements. &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:element name=&amp;quot;Person&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xs:complexType&amp;gt;&lt;br /&gt;
      &amp;lt;xs:simpleContent&amp;gt;&lt;br /&gt;
        &amp;lt;xs:extension base=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;xs:attribute name=&amp;quot;age&amp;quot; type=&amp;quot;xs:integer&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/xs:extension&amp;gt;&lt;br /&gt;
      &amp;lt;/xs:simpleContent&amp;gt;&lt;br /&gt;
    &amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;
  &amp;lt;/xs:element&amp;gt;&lt;br /&gt;
&amp;lt;/xs:schema&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>