May 28, 2021 XML Schema
This section introduces you to the string data types of XML Schema.
String data types are used for values that can contain strings.
String data types can contain characters, line breaks, carriage returns, and tabs.
Here's an example of a string declaration in a scheme:
The elements in the document should look something like this:
Or something like this:
Note: If you use string data types, the XML processor does not change the values in them.
The normalized string data type originates from the string data type.
The normalized string data type can also contain characters, but the XML processor removes lines, carriage returns, and tabs.
Here's an example of a string data type that is normalized in a schema:
The elements in the document should look something like this:
Or something like this:
Note: In the example above, the XML processor replaces all tabs with spaces.
Token data types also originate from string data types.
Token data types can also contain characters, but the XML processor removes line breaks, carriage returns, tabs, spaces at the beginning and end, and (continuous) spaces.
Here's an example of a token declaration in schema:
The elements in the document should look something like this:
Or something like this:
Note: In the example above, the XML parser removes the tab.
Note that all of the following data types are derived from string data types (except string data types themselves)!
Name | Describe |
---|---|
ENTITIES | |
ENTITY | |
Id | Strings that commit ID properties in XML (used only with schema properties) |
IDREF | Strings that commit IDREF properties in XML (used only with schema properties) |
IDREFS language | A string that contains a legitimate language id |
Name | A string that contains a legitimate XML name |
NCName | |
NMTOKEN | String that commits the NMTOKEN property in XML (used with schema property only) |
NMTOKENS | |
normalizedString | Strings that do not contain line breaks, carriage returns, or tabs |
Qname | |
string | String |
token | Strings that do not contain line breaks, carriage returns or tabs, opening or ending spaces, or multiple consecutive spaces |
Qualifications that can be used with string data types:
That's what string data types are covered in XML Schema.