May 28, 2021 XML Schema
XML Schema defines the elements of an XML file.
Simple elements are those that contain only text. It does not contain any other elements or properties.
Simple elements are those that contain only text. It does not contain any other elements or properties.
However, the "text only" qualification is easily misleading. T here are many types of text. It can be one of the types included in the XML Schema definition (boolean, string, data, and so on), or it can be a custom type that you define yourself.
You can also limit the content of a data type by adding a qualification, or facets, or you can ask the data to match a particular pattern.
Define the syntax of simple elements:
Here xxx refers to the name of the element and yyy refers to the data type of the element. XML Schema has many built-in data types.
Here are some XML elements:
This is the corresponding simple element definition:
Simple elements can have a specified default or fixed value.
When no other values are specified, the default values are automatically assigned to the element.
In the following example, the default value is "red":
Fixed values are also automatically assigned to elements, and you cannot specify another value.
In the following example, the fixed value is "red":
Tip: Simple elements cannot have properties. I f an element has a property, it is treated as a composite type. However, the property itself is always declared as a simple type, which is explained in the next section.