XML Schema string data type
XSD String Data Type
The String data type is used for values that can contain strings.
String Data Type
The string data type can contain characters, line feeds, carriage returns, and tab characters.
The following is an example of string declaration in a scheme:
The elements in the document should look something like this:
Or something like this:
Normalized String Data Type (NormalizedString Data Type) The normalized string data type is derived 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. The following is an example of normalizing the string data type in a schema:
<xs:element name="customer" type="xs:normalizedString" />
The elements in the document should look something like this: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 newlines, carriage returns, tabs, leading and trailing spaces, and (consecutive) spaces. The following is an example of token declaration in schema:
<xs:element name="customer" type="xs:token"/>
The elements in the document should look something like this:Note:>In the above example, the XML parser will remove tab characters.
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 | Submit the string of the ID attribute in XML (only used with the schema attribute) |
IDREF | Submit the string of the IDREF attribute in XML (only used with the schema attribute) |
IDREFS language | String containing the legal language id |
Name | String containing the legal XML name |
NCName | |
NMTOKEN | Submit the string of the NMTOKEN attribute in XML (only used with the schema attribute) |
NMTOKENS | |
normalizedString | A string that does not contain newlines, carriage returns, or tabs |
QName | |
string | String |
token | A string that does not contain a newline character, a carriage return or a tab character, a leading or trailing space, or multiple consecutive spaces |
pair of characters Restriction of the string data type (Restriction)
Restrictions that can be used with the string data type:
enumeration
length
maxLength
minLength
pattern (NMTOKENS, IDREFS, and ENTITIES cannot use this constraint )
whiteSpace