XSD SchemaLesson 88Free preview
XSD Complex Elements
This lesson is part of XML · All levels
Summary
A complex element is an element that contains a child, attribute, or both, and whose structure is defined by <xs:complexType>. There are four main forms: empty, containing only elements, containing only text, and mixed. Complex types can be written directly into the element as an anonymous type or named for reuse in many places.
Key points
- xs:complexType is used when an element has a child and/or attribute
- Four shapes: empty, element-only, text-only, and mixed
- Anonymous type written in <xs:element>, type named using the name attribute
- xs:sequence, xs:choice, and xs:all set the order of the children
- xs:extension and xs:restriction develop or limit other types
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.