XSD Data TypesLesson 102Free preview
XSD Reference
This lesson is part of XML · All levels
Summary
The ref attribute allows one element to refer to another global element so that the declaration is written enough once. A common pattern is to place global elements such as titles and authors under <xs:schema>, then to arrange complex structures with <xs:element ref="...">. The same is true for global attributes via <xs:attribute ref="...">.
Key points
- Ref may only designate global elements declared at the scheme level
- Ref should not be combined with attribute name or type
- Global elements can be used many times in many places.
- <xs:attribute ref="..."> refers to the global attribute
- Ref to the cross-nomenpace element is written with a prefix, for example ref="ns:title"
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.