Compound elements contain other elements and / or attributes. A compound element is an XML element that contains other elements and / or attributes. Empty element An element that contains other elements Elements that contain only text An element that contains elements and text 注意: All of the above elements can contain attributes! The compound element, “product”, is empty: The compound element, “employee”, contains only other elements: The compound XML element, “food”, contains only text: Compound XML elements, “description” contains elements and text: Look at this composite XML element, “employee”, which contains only other elements: In XML Schema, we have two ways to define compound elements: By naming this element, you can declare the “employee” element directly, like this: If you use the method described above, only “employee” can use the specified compound type. Notice that its child elements, “firstname” and “lastname”, are enclosed in the indicator < sequence >. You will be in the XSD 指示器 Learn more about indicators in this section. 2. “employee” 元素可以使用 type 属性,这个属性的作用是引用要使用的复合类型的名称: If you use the method described above, several elements can use the same compound type, such as this: You can also base an existing composite element on a composite element, and then add some elements, like this:
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. What is a compound element? ¶
There are four types of compound elements: ¶
Examples of compound elements ¶
<product pid="1345"/>
<employee>
<firstname>Johnfirstname>
<lastname>Smithlastname>
employee>
<food type="dessert">Ice creamfood>
<description>
It happened on <date lang="norwegian">03.03.99date> ....
description>
How do you define compound elements? ¶
<employee>
<firstname>Johnfirstname>
<lastname>Smithlastname>
employee>
<xs:element name="employee">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
xs:sequence>
xs:complexType>
xs:element>
<xs:element name="employee" type="personinfo"/>
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
xs:sequence>
xs:complexType>
<xs:element name="employee" type="personinfo"/>
<xs:element name="student" type="personinfo"/>
<xs:element name="member" type="personinfo"/>
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
xs:sequence>
xs:complexType>
<xs:element name="employee" type="fullpersoninfo"/>
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
xs:sequence>
xs:complexType>
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
xs:sequence>
xs:extension>
xs:complexContent>
xs:complexType>
Principles, Technologies, and Methods of Geographic Information Systems
102