最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
With indicators, we can control how elements are used in the document. There are seven indicators: Order indicator: All Choice Sequence Occurrence indicator: MaxOccurs MinOccurs Group indicator: Group name AttributeGroup name The Order indicator is used to define the order of elements. The < all > indicator states that child elements can appear in any order, and each child element must appear only once: 注意: When using the < all > indicator, you can set < minOccurs > to 0 or 1, while you can only set the < maxOccurs > indicator to 1 (< minOccurs > and < maxOccurs > will be covered later). The < choice > indicator specifies that one child element can appear or another child element (either one or the other): < sequence > specifies that child elements must appear in a specific order: The Occurrence indicator is used to define how often an element occurs. 注意: For all “Order” and “Group” indicators (any, all, choice, sequence, group name, and group reference), the default values for maxOccurs and minOccurs are 1. The < maxOccurs > indicator can specify the maximum number of times an element can appear: The above example shows that the child element “child_name” can appear at least once in the “person” element (where the default value for minOccurs is 1) and up to 10 times. The < minOccurs > indicator specifies the minimum number of times an element can appear: The above example shows that the child element “child_name” can appear at least 0 times and up to 10 times in the “person” element. 提示: To make the occurrence of an element unlimited, use the declaration maxOccurs= “unbounded”: A XML file named “Myfamily.xml”: The above XML file contains a root element named “persons”. Within this root element, we define three “person” elements. Each “person” element must contain a “full_name” element, and it can contain up to 5 “child_name” elements. 这是schema文件”family.xsd”: The Group indicator is used to define related batches of elements. Element groups are defined through group declarations: You must define an all, choice, or sequence element inside the group declaration. The following example defines a group named “persongroup”, which defines a set of elements that must appear in a precise order: After you have defined group, you can reference it in another definition: Property groups are defined through attributeGroup declarations: The following example defines a property group named “personattrgroup”: After you have defined the property group, you can reference it in another definition, like this: Indicator ¶
Order indicator ¶
All indicator ¶
<xs:element name="person"> <xs:complexType> <xs:all> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> xs:all> xs:complexType> xs:element>
Choice indicator ¶
<xs:element name="person"> <xs:complexType> <xs:choice> <xs:element name="employee" type="employee"/> <xs:element name="member" type="member"/> xs:choice> xs:complexType> xs:element>
Sequence indicator ¶
<xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> xs:sequence> xs:complexType> xs:element>
Occurrence indicator ¶
MaxOccurs indicator ¶
<xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="full_name" type="xs:string"/> <xs:element name="child_name" type="xs:string" maxOccurs="10"/> xs:sequence> xs:complexType> xs:element>
MinOccurs indicator ¶
<xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="full_name" type="xs:string"/> <xs:element name="child_name" type="xs:string" maxOccurs="10" minOccurs="0"/> xs:sequence> xs:complexType> xs:element>
A practical example: ¶
Group indicator ¶
Element group ¶
<xs:group name="groupname"> ... xs:group>
<xs:group name="persongroup"> <xs:sequence> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> <xs:element name="birthday" type="xs:date"/> xs:sequence> xs:group>
<xs:group name="persongroup"> <xs:sequence> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> <xs:element name="birthday" type="xs:date"/> xs:sequence> xs:group> <xs:element name="person" type="personinfo"/> <xs:complexType name="personinfo"> <xs:sequence> <xs:group ref="persongroup"/> <xs:element name="country" type="xs:string"/> xs:sequence> xs:complexType>
Attribute group ¶
<xs:attributeGroup name="groupname"> ... xs:attributeGroup>
<xs:attributeGroup name="personattrgroup"> <xs:attribute name="firstname" type="xs:string"/> <xs:attribute name="lastname" type="xs:string"/> <xs:attribute name="birthday" type="xs:date"/> xs:attributeGroup>
<xs:attributeGroup name="personattrgroup"> <xs:attribute name="firstname" type="xs:string"/> <xs:attribute name="lastname" type="xs:string"/> <xs:attribute name="birthday" type="xs:date"/> xs:attributeGroup> <xs:element name="person"> <xs:complexType> <xs:attributeGroup ref="personattrgroup"/> xs:complexType> xs:element>