Makina ya data ya nafasi ya XSD

Aidha data type iko inayotumia kufikia ukijumuisha mifano ya kawaida ya kifaa cha kompyuta.

String data type (String Data Type)

The string data type can contain characters, line breaks, 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>

Note:If you use the string data type, the XML processor will not change the value in it.

Normalized string data type (NormalizedString Data Type)

The normalized string data type originates from the string data type.

The normalized string data type can also contain characters, but the XML processor will remove line breaks, carriage returns, and tabs.

Here is an example of specifying the normalized string data type 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>

Note:In the above example, the XML processor will replace all tabs with spaces.

Token data type (Token Data Type)

The token data type also originates from the string data type.

The token data type can also contain characters, but the XML processor will remove line breaks, carriage returns, tabs, leading and trailing spaces, and (consecutive) spaces.

Here is an example of a token declaration in the 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>

Note:In this example, the XML parser will remove tabs.

String data type

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

Name Description
ENTITIES  
ENTITY  
ID In XML, submit the string of ID attribute (used only with schema attribute)
IDREF In XML, submit the string of IDREF attribute (used only with schema attribute)
IDREFS language String containing a valid language id
Name String containing a valid XML name
NCName  
NMTOKEN In XML, submit the string of NMTOKEN attribute (used only with schema attribute)
NMTOKENS  
normalizedString 不包含换行符、回车或制表符的字符串
QName  
string 字符串
token 不包含换行符、回车或制表符、开头或结尾空格或者多个连续空格的字符串

Kigeuka/kibarabara cha data ya nafasi ya string

Kigeuka/kibarabara ambavyo zingatumiwa na data ya nafasi ya string:

  • enumeration
  • length
  • maxLength
  • minLength
  • pattern (NMTOKENS、IDREFS na ENTITIES hapatikani kusababisha kina)
  • whiteSpace