XSD SchemaLesson 92Free preview
XSD Mixed
This lesson is part of XML · All levels
Summary
Mixed content allows text to be freely mixed with child elements within one element, similar to paragraphs on an article document. This feature is activated with <xs:complexType mixed="true"> and then determines the child through sequence, choice, or all. Without mixed="true", text that appears between children will render the document invalid.
Key points
- Mixed="true" on <xs:complexType> allows text and children to be simultaneous
- The text sequence is free, but the child must still meet the content model
- Mixed="false" is an innate value such that text between children is rejected
- Suitable for article content, rich descriptions, or comments
- The child remains subject to minOccurs and maxOccurs respectively
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.