15.2.19. XSD string data type

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

Page Views: 9 views

The string data type is used for values that can contain strings.

String data type (String Data Type)

String data types can contain characters, line feeds, carriage returns, and tabs.

Here is an example of a string declaration in a scheme:

<xs:element name="customer" type="xs:string"/> 

The elements in the document should look like this:

<customer>John Smithcustomer>    

Or something like this:

<customer> John Smith customer>    

注意: If you use a string data type, the XML processor does not change the value in it.

Normalize string data types (NormalizedString Data Type)

Normalized string data types are derived from string data types.

Normalized string data types can also contain characters, but the XML processor removes line breaks, carriage returns, and tabs.

Here is an example of normalizing string data types in a schema:

<xs:element name="customer" type="xs:normalizedString"/> 

The elements in the document should look like this:

<customer>John Smithcustomer>    

Or something like this:

<customer> John Smith customer>    

注意: In the above example, the XML processor replaces all tabs with spaces.

Token data type (Token Data Type)

The Token data type is also derived from the string data type.

The Token data type can also contain characters, but the XML processor removes newline characters, carriage returns, tabs, beginning and ending spaces, and (consecutive) spaces.

Here is an example of an token declaration in schema:

<xs:element name="customer" type="xs:token"/> 

The elements in the document should look like this:

<customer>John Smithcustomer>    

Or something like this:

<customer> John Smith customer>    

注意: In the above example, the XML parser removes tabs.

String data type

Note that all of the following data types are derived from the string data type (except the string data type itself)!

Name

Description

ENTITIES

ENTITY

ID

Submit a string for the ID attribute in XML (used only with the schema attribute)

IDREF

Submit a string for the IDREF attribute in XML (used only with the schema attribute)

IDREFS language

A string containing the legal language id

Name

A string containing a legal XML name

NCName

NMTOKEN

Submit a string for the NMTOKEN attribute in XML (used only with the schema attribute)

NMTOKENS

NormalizedString

A string that does not contain newline characters, carriage returns, or tabs

QName

String

String

Token

A string that does not contain newline characters, carriage returns or tabs, beginning or ending spaces, or multiple consecutive spaces

Qualification of string data types (Restriction)

Restrictions that can be used with string data types:

  • Enumeration

  • Length

  • MaxLength

  • MinLength

  • Pattern (this constraint cannot be used by NMTOKENS, IDREFS, and ENTITIES)

  • WhiteSpace

《地理信息系统原理、技术与方法》  97

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