XSD SchemaLesson 84Free preview
XSD <schema>
This lesson is part of XML · All levels
Summary
The <xs:schema> element is the root of any XML Schema file (.xsd) that defines the validation rules of an XML document. The xmlns:xs attribute sets the prefix xs for the XML Schema namespace, so that all declarations of elements and types use the prefix. Schemas can be stored as separate .xsd files or directly linked to a data document via the xsi:schemaLocation attribute.
Key points
- The roots of the scheme are always <xs:schema> with xmlns:xs="http://www.w3.org/2001/XMLSchema"
- Schema files are generally extended (.xsd)
- XML documents link the schema through xsi:schemaLocation or xsi:noNamespaceSchemaLocation
- TargetNamespace specifies the namespace defined by the scheme
- ElementFormDefault="qualified" makes the local element go qualified with the namespace scheme
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.