XSD SchemaLesson 83Free preview
XSD How To
This lesson is part of XML · All levels
Summary
The step of creating an XSD scheme starts with the root element <xs:schema> containing the XSD namespace, then declaring the element and type according to the document structure. Once the schema is complete, the XML document directs it through the xsi:schemaLocation or xsi:noNamespaceSchemaLocation attributes. Finally, documents are validated using a parser or validation tool like xmllint.
Key points
- Root scheme: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
- Declare the root element and its complex type
- XML refers to the schema with xsi:noNamespaceSchemaLocation="note.xsd"
- Xsi:schemaLocation contains the namespace pairs URI and the location of the schema
- The final validation can be with xmllint --schema or IDE
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.