15.2.12. XSD contains text only

发布时间 : 2025-10-25 12:23:28 UTC      

Page Views: 15 views

Compound elements that contain only text can contain text and attributes.

A compound element that contains only text

This type contains only simple content (text and attributes), so we will add simpleContent elements to this content. When using simple content, we have to define an extension or qualification within the simpleContent element, like this:

<xs:element name="somename">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="basetype">
        ....
        ....
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>
或者:
<xs:element name="somename">
  <xs:complexType>
    <xs:simpleContent>
      <xs:restriction base="basetype">
        ....
        ....
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

提示: Use extension or restriction elements to extend or restrict the basic simple types of elements. Here is an example of a XML element, “shoesize”, which contains only text:

<shoesize country="france">35</shoesize>

The following example declares a compound type whose content is defined as an integer value, and the “shoesize” element contains an attribute named “country”:

<xs:element name="shoesize">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="xs:integer">
        <xs:attribute name="country" type="xs:string" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

We can also set a name for the complexType element and have the type attribute of the “shoesize” element refer to this name (by using this method, several elements can refer to the same compound type):

<xs:element name="shoesize" type="shoetype"/>
<xs:complexType name="shoetype">
  <xs:simpleContent>
    <xs:extension base="xs:integer">
      <xs:attribute name="country" type="xs:string" />
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>
Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.