XSD SchemaLesson 85Free preview
XSD Elements
This lesson is part of XML · All levels
Summary
Simple elements are declared with <xs:element> which only carry names and types, so that the content is text value without children. Inbuilt types like xs:string, xs:integer, and xs:date can be used directly. Declarations can also carry default, fixed, as well as minOccurs and maxOccurs to set the initial value and number of appearances of elements.
Key points
- Declares elements of a simple type
- Default assigns a value when the element appears without content, fixed sets a fixed value
- MinOccurs="0" makes the element optional and maxOccurs="unbounded" allows repeating
- The built-in type xs:string, xs:decimal, xs:date, xs:boolean is used directly
- Global elements are declared directly below <xs:schema>
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.