15.2.10. XSD empty element

发布时间 : 2025-10-25 13:35:25 UTC      

Page Views: 10 views

Empty compound elements cannot contain content, only attributes.

Compound empty elements:

An empty XML element:

<product prodid="1345" /> 

The “product” element above has no content at all. In order to define a type without content, we must declare a type that contains only elements in its content, but we do not actually declare any elements, such as this:

<xs:element name="product"> <xs:complexType> <xs:complexContent> <xs:restriction base="xs:integer"> <xs:attribute name="prodid" type="xs:positiveInteger"/> xs:restriction> xs:complexContent> xs:complexType> xs:element>    

In the above example, we define a composite type with composite content. The complexContent element signals that we intend to define or extend the content model of a composite type, while the integer qualification declares an attribute but does not introduce any element content.

However, you can also declare this “product” element more compactly:

<xs:element name="product"> <xs:complexType> <xs:attribute name="prodid" type="xs:positiveInteger"/> xs:complexType> xs:element>    

Or you can give a name to a complexType element, then set a type attribute for the “product” element and reference the complexType name (by using this method, several elements can refer to the same compound type):

<xs:element name="product" type="prodtype"/> <xs:complexType name="prodtype"> <xs:attribute name="prodid" type="xs:positiveInteger"/> xs:complexType>      
                
                
            
        
        
《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。