15.2.19. XSD string data type

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

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 Smith</customer>

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 Smith</customer>

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 Smith</customer>

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

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.