HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
All attributes are declared as simple types.
Simple elements can not have attributes. If an element has attributes, it will be treated as some kind of complex type. But the property itself is always used as a simple type declaration.
The syntax is defined properties
Here, xxx is the property name, yyy provides that the data type of the attribute. XML Schema has a lot of built-in data types.
This is the XML elements with attributes:
This is the corresponding attribute definition:
Property has a specified default value or a fixed value.
When no other value is specified, the default value is automatically assigned to the element.
In the following example, the default value is "EN":
Fixed values are also automatically assigned to the elements, and you can not predetermined additional value.
In the following example, the fixed value is "EN":
In case of default, the attribute is optional. To specify attributes is required, please use the "use" attribute:
When an XML element or attribute has a data type is defined, it will add to the content defining element or attribute.
If the type of XML element is "xs: date", and the content it contains is similar to "Hello World" string element will not (through) authentication.
Through XML schema, you can also add your own to define your XML elements and attributes. These limits are called facet (Editor's note: meaning (polyhedron) surface, can be translated as defined surface). You will learn more about the facet of knowledge in the following section.