XSD SchemaLesson 94Free preview
XSD <any>
This lesson is part of XML · All levels
Summary
<xs:any> expands the content model to accept other elements that have not yet been declared in the schema, so that the structure remains open to extensible data. These elements are always in a sequence, choice, or group, and are controlled by minOccurs, maxOccurs, and processContents. With xs:any, additional elements from third parties can be accepted without changing the main scheme.
Key points
- <xs:any> is valid only within content models such as sequence, choice, or group
- Namespace specifies the accepted namespace, e.g. ##other or ##any
- ProcessContents="lax" validates when the scheme is available, "skip" misses the validation
- MinOccurs and maxOccurs set the number of unknown elements received
- Suitable for opening vendor extensions without breaking the contract scheme
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.